1 / 6

Java Assignment Related

Java Assignment Related. Message digest. MessageDigest class getInstance(“SHA”) update(byte []) dijest(); digest(byte []) Producing byte array DataOutputStream to ByteOutputStream Write data types: writeLong(l) toByteArray in ByteOutputStream. Key, KeyGenerator. Key:

ggerrity
Download Presentation

Java Assignment Related

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java Assignment Related

  2. Message digest • MessageDigest class • 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: • 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. CipherOutputstreamCipherInputstream • 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) • 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

More Related