Comment savoir quel algorithme de [ cryptage ] sont pris en charge par mon JVM?

Je suis en utilisant Jasypt pour le chiffrement. C'est mon code:

public class Encryptor {    
    private final static StandardPBEStringEncryptor pbeEncryptor = new StandardPBEStringEncryptor();
    private final static String PASSWORD = "FBL";
    private final static String ALGORITHM = "PBEWithMD5AndTripleDES";

    static{
        pbeEncryptor.setPassword( PASSWORD );
        //pbeEncryptor.setAlgorithm( ALGORITHM );       
    }

    public static String getEncryptedValue( String text ){
        return pbeEncryptor.encrypt( text );
    }

    public static String getDecryptedValue( String text ){
        return pbeEncryptor.decrypt( text );
    }

}

Décommentez la setAlgorithm ligne et il lèvera une exception

org.jasypt.des exceptions.EncryptionOperationNotPossibleException:
Le chiffrement a soulevé une excep tion. Un
cause possible est que vous êtes en utilisant de forts
les algorithmes de chiffrement et vous n'avez pas
installé le Java Cryptography Ex
tension (JCE) Force Illimitée
La compétence Politique des Fichiers dans ce Java
La Machine Virtuelle

api dit:

Définit l'algorithme utilisé pour
cryptage Définit l'algorithme
utilisé pour le chiffrement, comme
PBEWithMD5AndDES.

Cet algorithme doit être pris en charge par
votre JCE fournisseur (si vous spécifiez un,
ou la JVM par défaut du fournisseur si vous
ne le font pas) et, si elle est prise en charge,
pouvez également spécifier le mode et le rembourrage pour
c', ALGORITHME de type/MODE/REMBOURRAGE.

consulter: http://www.jasypt.org/api/jasypt/apidocs/org/jasypt/encryption/pbe/StandardPBEStringEncryptor.html#setAlgorithm%28java.lang.String%29

Maintenant, lorsque vous commentez 'setAlgorithm' il va utiliser l'Algorithme par défaut [ je suppose que c'est le md5 ], et il fonctionne parfaitement. Cela signifie que md5 est pris en charge par mon JVM. Maintenant, comment savoir ce que les autres algorithmes de chiffrement sont pris en charge par mon JVM.

Merci,

InformationsquelleAutor Rakesh Juyal | 2010-09-10