Wednesday, October 6, 2010

Cellular Respiration Reptiles

JCA-Java Architecture Criptography

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
Independence indipendences Algorithm implementation or use of abstract classes such as "engines " who declares the functionality of a given type of encryption algorithm, then uses class" provider " che implementano un certo insieme di funzionalità crittografiche per un Criptographic Service Provider(CSP) .

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 "
Cryptographic service provider: each class engine "has a corresponding SPI that defines exactly one crypto method implemented by the CSP.

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.
Il provider SUN include:un'implementazione algorithm DSA (Digital Signature Algorithm ), an algorithm MD5 and SHA-1 of MessageDigest a KeyPairGenerator for DSA , AlgorithmParameter and AlgorithmParameterGenerator for DSA, a KeyFactory for DSA, a CertificateFactory for X.509 certificates and CRLs, an implementation of the owner JKS KeyStore.

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:
  • symmetrical block ciphers and stream ciphers
  • asymmetric ciphers
  • password
applications:
  • Date
  • I / O streams
  • Serializable Object
in mechanisms such as:
  • 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:
  1. if x-> h (x), x and y are different, you can not have h (y) = h (x)
  2. you can not have collisions
For example, the Internet is used MD5-128 bits does not guarantee anything with regard to the collision.
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
Java APIs are:
  • 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