Package org.apache.shiro.crypto

Examples of org.apache.shiro.crypto.AesCipherService.encrypt()


     * @param key      the encryption key
     * @return encrypted password in base64 encoding
     */
    public static String encryptPassword(String password, byte[] key) {
        AesCipherService cipherService = new AesCipherService();
        ByteSource encrypted = cipherService.encrypt(password.getBytes(), key);
        return encrypted.toBase64();
    }

    /**
     * Returns decrypted password using given key
View Full Code Here


  private static byte[] encrypt(byte[] serialized) {
    byte[] value = serialized;
    CipherService cipherService = new AesCipherService();
    if (cipherService != null) {
      ByteSource byteSource = cipherService.encrypt(serialized, Base64.decode("kPH+bIxk5D2deZiIxcaaaA=="));
      value = byteSource.getBytes();
    }
    return value;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.