Download presentation
Presentation is loading. Please wait.
1
Java Assignment Related
2
Message digest MessageDigest class Producing byte array
getInstance(“SHA”) update(byte []) dijest(); digest(byte []) Producing byte array DataOutputStream to ByteOutputStream Write data types: writeLong(l) toByteArray in ByteOutputStream
3
Key, KeyGenerator Key: KeyGenerator:
top-level interface for all keys. defines the functionality of all key objects. KeyGenerator: This class provides the functionality of a (symmetric) key generator. static KeyGenerator getInstance(String algorithm) Generates a KeyGenerator object for the specified algorithm. void init(SecureRandom random) Initializes this key generator. SecretKey generateKey() Generates a secret key.
4
Cipher, static Cipher getInstance(String transformation)
Generates a Cipher object that implements the specified transformation. You can use “DES/ECB/PKCS5Padding” void init(int opmode, Key key) Initializes this cipher with a key. Field Detail public static final int ENCRYPT_MODE Constant used to initialize cipher to encryption mode. public static final int DECRYPT_MODE Constant used to initialize cipher to decryption mode.
5
CipherOutputstream CipherInputstream
CipherOutputStream(OutputStream os, Cipher c) Constructs a CipherOutputStream from an OutputStream and a Cipher. void write(byte[] b) Writes b.length bytes from the specified byte array to this output stream. CipherInputStream(InputStream is, Cipher c) Constructs a CipherInputStream from an InputStream and a Cipher. int read(byte[] b) Reads up to b.length bytes of data from this input stream into an array of bytes. void close() Closes this output/input stream and releases any system resources associated with this stream.
6
Big Integer BeigInteger(1, messagebytes) x/y mod z
BigInteger.valueOf(1) x/y mod z X.multiply(y.modPow(kOne.negate(), z)).mod(z) k relatively prime to z k.gcd(z).equals(kOne) == true
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.