test_class.file: src/de/slackspace/openkeepass/crypto/AesTest.java
test_class.identifier: AesTest
test_case.body: @Test
      public void shouldTransformKeyWith6000Rounds() {
          byte[] key = ByteUtils.hexStringToByteArray("3ecaacce890184af4fe7d6f6369dd14eb4a8a9641fefe346c9fbacb03c82a7c4");
          byte[] data = ByteUtils.hexStringToByteArray("2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c");
  
          byte[] transformedKey = Aes.transformKey(key, data, 6000);
  
          Assert.assertTrue("Hash must be 8ad8a3addb033449fbee13c3fbf1ad74b9760d6c21048f08027b2ddc8adef20a",
                  Arrays.equals(ByteUtils.hexStringToByteArray("8ad8a3addb033449fbee13c3fbf1ad74b9760d6c21048f08027b2ddc8adef20a"), transformedKey));
      }
test_case.class_method_signature: AesTest.shouldTransformKeyWith6000Rounds()
test_case.full_signature: @Test public void shouldTransformKeyWith6000Rounds()
test_case.identifier: shouldTransformKeyWith6000Rounds
test_case.invocations: hexStringToByteArray hexStringToByteArray transformKey assertTrue equals hexStringToByteArray
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldTransformKeyWith6000Rounds()
focal_class.declarator: MSG_KEY_MUST_NOT_BE_NULL = "Key must not be null"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_KEY_MUST_NOT_BE_NULL = "Key must not be null";
focal_class.type: String
focal_class.var_name: MSG_KEY_MUST_NOT_BE_NULL
focal_class.declarator: MSG_IV_MUST_NOT_BE_NULL = "IV must not be null"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_IV_MUST_NOT_BE_NULL = "IV must not be null";
focal_class.type: String
focal_class.var_name: MSG_IV_MUST_NOT_BE_NULL
focal_class.declarator: MSG_DATA_MUST_NOT_BE_NULL = "Data must not be null"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_DATA_MUST_NOT_BE_NULL = "Data must not be null";
focal_class.type: String
focal_class.var_name: MSG_DATA_MUST_NOT_BE_NULL
focal_class.declarator: KEY_TRANSFORMATION = "AES/ECB/NoPadding"
focal_class.modifier: private static final
focal_class.original_string: private static final String KEY_TRANSFORMATION = "AES/ECB/NoPadding";
focal_class.type: String
focal_class.var_name: KEY_TRANSFORMATION
focal_class.declarator: DATA_TRANSFORMATION = "AES/CBC/PKCS5Padding"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATA_TRANSFORMATION = "AES/CBC/PKCS5Padding";
focal_class.type: String
focal_class.var_name: DATA_TRANSFORMATION
focal_class.declarator: KEY_ALGORITHM = "AES"
focal_class.modifier: private static final
focal_class.original_string: private static final String KEY_ALGORITHM = "AES";
focal_class.type: String
focal_class.var_name: KEY_ALGORITHM
focal_class.file: src/de/slackspace/openkeepass/crypto/Aes.java
focal_class.identifier: Aes
focal_class.class_method_signature: Aes.Aes()
focal_class.full_signature: private  Aes()
focal_class.identifier: Aes
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  Aes()
focal_class.class_method_signature: Aes.decrypt(byte[] key, byte[] ivRaw, byte[] data)
focal_class.full_signature: public static byte[] decrypt(byte[] key, byte[] ivRaw, byte[] data)
focal_class.identifier: decrypt
focal_class.modifiers: public static
focal_class.parameters: (byte[] key, byte[] ivRaw, byte[] data)
focal_class.return: byte[]
focal_class.signature: byte[] decrypt(byte[] key, byte[] ivRaw, byte[] data)
focal_class.class_method_signature: Aes.encrypt(byte[] key, byte[] ivRaw, byte[] data)
focal_class.full_signature: public static byte[] encrypt(byte[] key, byte[] ivRaw, byte[] data)
focal_class.identifier: encrypt
focal_class.modifiers: public static
focal_class.parameters: (byte[] key, byte[] ivRaw, byte[] data)
focal_class.return: byte[]
focal_class.signature: byte[] encrypt(byte[] key, byte[] ivRaw, byte[] data)
focal_class.class_method_signature: Aes.transformData(byte[] key, byte[] ivRaw, byte[] encryptedData, int operationMode)
focal_class.full_signature: private static byte[] transformData(byte[] key, byte[] ivRaw, byte[] encryptedData, int operationMode)
focal_class.identifier: transformData
focal_class.modifiers: private static
focal_class.parameters: (byte[] key, byte[] ivRaw, byte[] encryptedData, int operationMode)
focal_class.return: byte[]
focal_class.signature: byte[] transformData(byte[] key, byte[] ivRaw, byte[] encryptedData, int operationMode)
focal_class.class_method_signature: Aes.transformKey(byte[] key, byte[] data, long rounds)
focal_class.full_signature: public static byte[] transformKey(byte[] key, byte[] data, long rounds)
focal_class.identifier: transformKey
focal_class.modifiers: public static
focal_class.parameters: (byte[] key, byte[] data, long rounds)
focal_class.return: byte[]
focal_class.signature: byte[] transformKey(byte[] key, byte[] data, long rounds)
focal_class.class_method_signature: Aes.createCryptoException(Throwable e)
focal_class.full_signature: private static KeePassDatabaseUnreadableException createCryptoException(Throwable e)
focal_class.identifier: createCryptoException
focal_class.modifiers: private static
focal_class.parameters: (Throwable e)
focal_class.return: KeePassDatabaseUnreadableException
focal_class.signature: KeePassDatabaseUnreadableException createCryptoException(Throwable e)
focal_method.body: public static byte[] transformKey(byte[] key, byte[] data, long rounds) {
          if (key == null) {
              throw new IllegalArgumentException(MSG_KEY_MUST_NOT_BE_NULL);
          }
          if (data == null) {
              throw new IllegalArgumentException(MSG_DATA_MUST_NOT_BE_NULL);
          }
          if (rounds < 1) {
              throw new IllegalArgumentException("Rounds must be > 1");
          }
  
          try {
              Cipher c = Cipher.getInstance(KEY_TRANSFORMATION);
              Key aesKey = new SecretKeySpec(key, KEY_ALGORITHM);
              c.init(Cipher.ENCRYPT_MODE, aesKey);
  
              for (long i = 0; i < rounds; ++i) {
                  c.update(data, 0, 16, data, 0);
                  c.update(data, 16, 16, data, 16);
              }
  
              return data;
          } catch (NoSuchAlgorithmException e) {
              throw new UnsupportedOperationException("The specified algorithm is unknown", e);
          } catch (NoSuchPaddingException e) {
              throw new UnsupportedOperationException("The specified padding is unknown", e);
          } catch (InvalidKeyException e) {
              throw new KeePassDatabaseUnreadableException(
                      "The key has the wrong size. Have you installed Java Cryptography Extension (JCE)? Is the master key correct?", e);
          } catch (ShortBufferException e) {
              throw new AssertionError(e);
          }
      }
focal_method.class_method_signature: Aes.transformKey(byte[] key, byte[] data, long rounds)
focal_method.full_signature: public static byte[] transformKey(byte[] key, byte[] data, long rounds)
focal_method.identifier: transformKey
focal_method.invocations: getInstance init update update
focal_method.modifiers: public static
focal_method.parameters: (byte[] key, byte[] data, long rounds)
focal_method.return: byte[]
focal_method.signature: byte[] transformKey(byte[] key, byte[] data, long rounds)