List of utility methods to do Password Descrypt
String | decryptionKey(String password) decryption Key byte[] keyByte1 = key1.getBytes(); byte[] keyByte2 = key2.getBytes(); byte[] pwdByte = hexStr2Bytes(password); for (int i = 0; i < pwdByte.length; i++) { pwdByte[i] = (byte) (pwdByte[i] ^ keyByte2[i % keyByte2.length]); byte[] lastByte = new byte[pwdByte.length - keyByte1.length]; for (int i = 0; i < lastByte.length; i++) { ... |
String | decryptionKey(String password) decryption Key byte[] keyByte1 = key1.getBytes(); byte[] keyByte2 = key2.getBytes(); byte[] pwdByte = hexStr2Bytes(password); for (int i = 0; i < pwdByte.length; i++) { pwdByte[i] = (byte) (pwdByte[i] ^ keyByte2[i % keyByte2.length]); byte[] lastByte = new byte[pwdByte.length - keyByte1.length]; for (int i = 0; i < lastByte.length; i++) { ... |
String | decrypt(String password, String encryptedData) decrypt byte[] secretKey = generateKey(password.getBytes()); SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey, CIPHER_ALGORITHM); Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, secretKeySpec); byte[] encrypted = Base64.decode(encryptedData, Base64.DEFAULT); byte[] decrypted = cipher.doFinal(encrypted); return new String(decrypted); ... |