JavaサーバーとAndroidクライアントの間で暗号化を実行しようとしています。いくつかの研究の後、ここでPBEWithMD5AndDESアルゴリズムを使用したJava暗号化
は、私の暗号化設定されている:
public static String encryptionAlgoirthm = "DES";
public static short encryptionBitCount = 128;
public static String hashingAlgorithm = "PBEWithMD5AndDES";
public static short hashingCount = 512;
public static String cipherTransformation = "DES/CBC/PKCS5Padding";
しかし、私のCentOSのVPS上でサーバを実行しようとしたとき、私は、次を得る:
Algorithm [PBEWithMD5AndDES] of type [SecretKeyFactory] from provider [gnu.javax.security.auth.callback.GnuCallbacks: name=GNU-CALLBACKS version=2.1] is not found.
ここにありますコード:
KeySpec keySpec = new PBEKeySpec(EncryptionSettings.password, EncryptionSettings.salt, EncryptionSettings.hashingCount, EncryptionSettings.encryptionBitCount);
SecretKey tmpKey = null;
try
{
tmpKey = SecretKeyFactory.getInstance(EncryptionSettings.hashingAlgorithm).generateSecret(keySpec);
}
catch (final InvalidKeySpecException e)
{
Console.writeFatalError("Unable to generate key: invalid key specification");
}
catch (final NoSuchAlgorithmException e)
{
Console.writeFatalError("Unable to generate key: encryption algorithm not supported - " + e.getMessage());
}
これを修正するにはどうすればよいですか?
コードを貼り付けた場合、 "encryptionAlgoirthm'のスペルが間違っています – rossum