We have already talked about encryption for the Java language.
now to speak of JCA, the basic framework for encryption, is built around the J2SA (Java 2 Security Architecture). It is based on the principles of
Criptography Service Provider Architecture :
- independence of implementation (Algorithm indipendences)
- interoperability
- extensibility
In genere un'applicazione crittografica può richiedere genericamente un'implementazione di un dato algoritmo senza curarsi di quale provider lo fornisca, infatti una volta installati possono coesistere uno o più CSP anche di differenti produttori, il provider di default si chiama SUN ed è integrato nel JDK.
In Pratica:
- Engine class : definiscea crypto service in an absract class senza implementazione
- Service provider interface : provvede ad una crypto interface application via " engine "
main engine class:
- KEY: defisce features shared by chiva "opaque"
- KEY SPEC: defines a key-type transparent
- KeyFactory: takes a key type KEY "opaque" or "transparent"
- KeyPairGenerator: generates una coppia di chiavi assimentriche
- AlgorithmParameters : gestisce i parametri di un algoritmo
- AlgorithmParametersGenerator :genera i set di parametri di un algoritmo
- MessageDigest: calcola l'hash di dati specifici
- SecureRandom :genera numeri causali o pseudo casuali
- Signature :appone e verifica la firma digitale
- CertificateFactory :crea e revoca certificati di chiavi pubbliche
- KeyStore :crea e gestisce un database(Keystore) di chiavi e certificati sicuri.
extensions JCE (Java Cryptographic Extension) and JSSE (Java Secure Sockects extension) implementano ed estendono le tecniche crittografiche definite dalla JCA fornendo CSP alternativi a SUN .
Invece i restanti set di package offrono funzionalità di sicurezza aggiuntive e sono quindi complementari alla JCA .
- JAAS :servizi di autenticazione, amministrazione e autorizzazione
- CertPath: gestione dei certificati e catene di certificati
- JGSS: meccanismi di comunicazione generici e specifici per beyberos v5
JCE
Java Cryptographic Extension
La JCE has the task of providing a complete implementation of encryption and decryption capabilities declared by the JCA .
JCE offers support:
JCE offers support:
- symmetrical block ciphers and stream ciphers
- asymmetric ciphers
- password
- Date
- I / O streams
- Serializable Object
- MAC (Message Authentication Code)
- Keygenerator / keyAgreement
JCA Message-Digest
Java Architecture Criptography offer the class "engine" MessageDigest abstract, which shall act as a design feature to provide secure messaging with encryption algorithm SHA-1 or MD5 , this encrypted message is called: Message Digest or simply denoted by MD.
A message digest is a clear message of variable length in a message translated into "safe" fixed-length.
An MD has two properties:
- if x-> h (x), x and y are different, you can not have h (y) = h (x)
- you can not have collisions
Java APIs are:
- MessageDigest.getInstance ("MD5") to obtain an MD
- . Update (plaintext) with MD to calculate the plaintext
- . Digest () to read the message digest
JCA-Message Authentication Code (MAC)
MACs use a key to preserving the integrity of messaggio.JCA supports the algorithms:
- HMAC/SHA-1
- HMAC/MD5
- KeyGenerator.getInstance (HMACMD5 ") and . GenerateKey () to generate the key
- Mac.getInstance (HMACMD5 ") creates an object MAC
- . Init (plaintext) and . DoFinal () initialize a Mac object
- . Update (plaintext) and . doFinal () calculate the MAC object in plain text
0 comments:
Post a Comment