@Test public void encryptionOfDateOfBirthShouldBeRandomized() { Long dob = 19850101L; String encryptedDOB = encryptAsBase64String(dob); assertThat(encryptAsBase64String(dob), not(encryptedDOB)); }
public static String encryptAsBase64String(Integer input) { return encryptAsBase64String(input.longValue()); }
SensitiveDataCryptoUtils { public static String encryptAsBase64String(Integer input) { return encryptAsBase64String(input.longValue()); } }
SensitiveDataCryptoUtils { public static String encryptAsBase64String(Integer input) { return encryptAsBase64String(input.longValue()); } private  SensitiveDataCryptoUtils(); }
SensitiveDataCryptoUtils { public static String encryptAsBase64String(Integer input) { return encryptAsBase64String(input.longValue()); } private  SensitiveDataCryptoUtils(); static synchronized void configure(SensitiveDataCryptoUtilsConfiguration configuration); static SecretKey buildSecretKey(byte[] keyBytes, String algo); static SecretKey buildSecretKey(int lengthInBits, String algo); static String buildMACAsBase64String(String input); static String buildSaltedMACAsBase64String(String input); static byte[] buildMAC(String input); static byte[] buildMAC(String input, byte[] salt); static byte[] buildMAC(byte[] input, byte[] salt); static boolean verifyMAC(String message, String macAsBase64); static boolean verifySaltedMAC(String message, String macAndSaltAsBase64); static String encryptAsBase64String(Integer input); static String encryptAsBase64String(Long input); static String encryptAsBase64String(String input); static byte[] encrypt(String input); static byte[] encrypt(byte[] input); static Long decryptAsLong(String base64Input); static Long decryptAsLong(byte[] input); static String decryptAsString(String base64Input); static String decryptAsString(byte[] input); static byte[] decrypt(byte[] input); static byte[] sealObject(Serializable object); static Object unsealObject(byte[] encryptedObject); static String generateStrongPasswordHash(char[] password); static boolean validateStrongPasswordHash(char[] passwd, String storedHash); }
SensitiveDataCryptoUtils { public static String encryptAsBase64String(Integer input) { return encryptAsBase64String(input.longValue()); } private  SensitiveDataCryptoUtils(); static synchronized void configure(SensitiveDataCryptoUtilsConfiguration configuration); static SecretKey buildSecretKey(byte[] keyBytes, String algo); static SecretKey buildSecretKey(int lengthInBits, String algo); static String buildMACAsBase64String(String input); static String buildSaltedMACAsBase64String(String input); static byte[] buildMAC(String input); static byte[] buildMAC(String input, byte[] salt); static byte[] buildMAC(byte[] input, byte[] salt); static boolean verifyMAC(String message, String macAsBase64); static boolean verifySaltedMAC(String message, String macAndSaltAsBase64); static String encryptAsBase64String(Integer input); static String encryptAsBase64String(Long input); static String encryptAsBase64String(String input); static byte[] encrypt(String input); static byte[] encrypt(byte[] input); static Long decryptAsLong(String base64Input); static Long decryptAsLong(byte[] input); static String decryptAsString(String base64Input); static String decryptAsString(byte[] input); static byte[] decrypt(byte[] input); static byte[] sealObject(Serializable object); static Object unsealObject(byte[] encryptedObject); static String generateStrongPasswordHash(char[] password); static boolean validateStrongPasswordHash(char[] passwd, String storedHash); static final Charset ENCRYPTION_CHARSET; }