0% found this document useful (0 votes)
205 views10 pages

Java Cryptography Architecture: Crypto/Cryptospec - HTML

The Java Cryptography Architecture provides an implementation-independent framework for encryption, digital signatures, and secure random numbers through pluggable security providers. It defines base classes like Provider and engine classes like Cipher and MessageDigest that applications use to access cryptographic services without needing to implement algorithms directly. The architecture ensures interoperability between providers and allows new algorithms to be added through a common interface.

Uploaded by

Pugal Nadar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
205 views10 pages

Java Cryptography Architecture: Crypto/Cryptospec - HTML

The Java Cryptography Architecture provides an implementation-independent framework for encryption, digital signatures, and secure random numbers through pluggable security providers. It defines base classes like Provider and engine classes like Cipher and MessageDigest that applications use to access cryptographic services without needing to implement algorithms directly. The architecture ensures interoperability between providers and allows new algorithms to be added through a common interface.

Uploaded by

Pugal Nadar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Java Cryptography Architecture

http://java.sun.com/javase/6/docs/technotes/guides/security/
crypto/CryptoSpec.html
Design principles

 Implementation independence
 Applications do not need to implement security
algorithms
 Services are implemented in providers pluggable
into the Java platform
 Implementation interoperability - providers are
interoperable
 Algorithm exntensibility
Architecture
Providers

java.security.Provider - base class of all


providers
 advertises algorithms
Supply concrete implementations
Provider implicit

md = MessageDigest.getInstance(“MD5”)
md = MessageDigest.getInstance(“MD5”,”ProviderC”)

Provider explicit
Engine Classes

Provide the interface to a specific type of


cryptographic service
 cryptographic operatoins
 generators or converers of cryptographic
material
 objects (keystores or certificates)
Example Engine Classes
Signature
KeyStore
SecureRandom

Cipher

MessageDigest
MAC
How does it work?

import javax.crypto.*;

Cipher c = Cipher.getInstance("AES");
c.init(ENCRYPT_MODE, key);
SecureRandom

 Seeding synchronized public void setSeed(byte[] seed)


public void setSeed(long seed)

 Using the object


synchronized public void nextBytes(byte[] bytes)

 Generate seed bytes


byte[] generateSeed(int numBytes)
MessageDigest

 Updating the object


void update(byte input)
void update(byte[] input)

 Computing the digest


byte[] digest()
byte[] digest(byte[] input)
Your Best Friend

Look up API docs for the relevant


packages
 java.security
 javax.crypto
JCA reference guide
 http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/
CryptoSpec.html

You might also like