Package com.microej.crypto.test
Class PBES2CipherTest
- java.lang.Object
-
- com.microej.crypto.test.PBES2CipherTest
-
public class PBES2CipherTest extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PBES2CipherTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestPBES2_EmptyPassword_Fixed_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with an empty password, fixed salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_EmptyPassword_Fixed_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with an empty password, fixed salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_EmptyPassword_Fixed_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with an empty password, fixed salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a fixed 16Bytes password, fixed salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a fixed 16Bytes password, fixed salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a fixed 16Bytes password, fixed salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a fixed 1Byte password, fixed salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a fixed 1Byte password, fixed salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a fixed 1Byte password, fixed salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a fixed 32Bytes password, fixed salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a fixed 32Bytes password, fixed salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a fixed 32Bytes password, fixed salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a fixed 64Bytes password, fixed salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a fixed 64Bytes password, fixed salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a fixed 64Bytes password, fixed salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_No_Params()Test the all supported PBES2 ciphers without any parameters, encrypting 80 bytes of data (size irrelevant).voidtestPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a random 16Bytes password, random salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a random 16Bytes password, random salt , iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a random 16Bytes password, random salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Random_1BytePassword_Random_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a random 1Byte password, random salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Random_1BytePassword_Random_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a random 1Byte password, random salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Random_1BytePassword_Random_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a random 1Byte password, random salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a random 32Bytes password, random salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a random 32Bytes password, random salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a random 32Bytes password, random salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_16Bytes()Test the all supported PBES2 ciphers with a random 64Bytes password, random salt, iteration count and IV, encrypting 16 bytes of data.voidtestPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_1Byte()Test the all supported PBES2 ciphers with a random 64Bytes password, random salt, iteration count and IV, encrypting 1 byte of data.voidtestPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_80Bytes()Test the all supported PBES2 ciphers with a random 64Bytes password, random salt, iteration count and IV, encrypting 80 bytes of data.voidtestPBES2_Wrong_Params()Test the all supported PBES2 ciphers with bad parameters.
-
-
-
Method Detail
-
testPBES2_EmptyPassword_Fixed_Salt_ICount_IV_1Byte
public void testPBES2_EmptyPassword_Fixed_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with an empty password, fixed salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_EmptyPassword_Fixed_Salt_ICount_IV_16Bytes
public void testPBES2_EmptyPassword_Fixed_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with an empty password, fixed salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_EmptyPassword_Fixed_Salt_ICount_IV_80Bytes
public void testPBES2_EmptyPassword_Fixed_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with an empty password, fixed salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_1Byte
public void testPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 1Byte password, fixed salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_16Bytes
public void testPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 1Byte password, fixed salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_80Bytes
public void testPBES2_Fixed_1BytePassword_Fixed_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 1Byte password, fixed salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_1Byte
public void testPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 16Bytes password, fixed salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_16Bytes
public void testPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 16Bytes password, fixed salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_80Bytes
public void testPBES2_Fixed_16BytesPassword_Fixed_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 16Bytes password, fixed salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_1Byte
public void testPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 32Bytes password, fixed salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_16Bytes
public void testPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 32Bytes password, fixed salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_80Bytes
public void testPBES2_Fixed_32BytesPassword_Fixed_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 32Bytes password, fixed salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_1Byte
public void testPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 64Bytes password, fixed salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_16Bytes
public void testPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 64Bytes password, fixed salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_80Bytes
public void testPBES2_Fixed_64BytesPassword_Fixed_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a fixed 64Bytes password, fixed salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against expected data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_1BytePassword_Random_Salt_ICount_IV_1Byte
public void testPBES2_Random_1BytePassword_Random_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 1Byte password, random salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_1BytePassword_Random_Salt_ICount_IV_16Bytes
public void testPBES2_Random_1BytePassword_Random_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 1Byte password, random salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_1BytePassword_Random_Salt_ICount_IV_80Bytes
public void testPBES2_Random_1BytePassword_Random_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 1Byte password, random salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_1Byte
public void testPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 16Bytes password, random salt , iteration count and IV, encrypting 1 byte of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_16Bytes
public void testPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 16Bytes password, random salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_80Bytes
public void testPBES2_Random_16BytesPassword_Random_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 16Bytes password, random salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_1Byte
public void testPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 32Bytes password, random salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_16Bytes
public void testPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 32Bytes password, random salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_80Bytes
public void testPBES2_Random_32BytesPassword_Random_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 32Bytes password, random salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_1Byte
public void testPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_1Byte() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 64Bytes password, random salt, iteration count and IV, encrypting 1 byte of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_16Bytes
public void testPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_16Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 64Bytes password, random salt, iteration count and IV, encrypting 16 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_80Bytes
public void testPBES2_Random_64BytesPassword_Random_Salt_ICount_IV_80Bytes() throws java.lang.ExceptionTest the all supported PBES2 ciphers with a random 64Bytes password, random salt, iteration count and IV, encrypting 80 bytes of data. Compare encrypted data against decrypted data.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_No_Params
public void testPBES2_No_Params() throws java.lang.ExceptionTest the all supported PBES2 ciphers without any parameters, encrypting 80 bytes of data (size irrelevant). The encrypting cipher generates its own salt and IV, so a decrypting cipher initialized with other parameters must not give the plaintext back.- Throws:
java.lang.Exception- if the encryption fails.
-
testPBES2_Wrong_Params
public void testPBES2_Wrong_Params() throws java.lang.ExceptionTest the all supported PBES2 ciphers with bad parameters. Expected exceptions if: non-ASCII password is provided, small salt is provided, negative iteration count is provided or no IV is provided for the encryption cipher (in which case the encryption cipher will generate a random one, but the decrypting cipher will not have it so it can't decrypt).- Throws:
java.lang.Exception- if the encryption or decryption fails.
-
-