Tag: spring security

解密在Android设备上加密的字符串

在Android 4.4设备上,使用spring-android-auth 1.0.1.RELEASE模块中的org.springframework.security.crypto.encrypt.AndroidEncryptors类对字符串进行了加密。 所以例如… // naturally, salt and password are normally different String salt = "75f4c92894b2f3e7"; String password = "password"; org.springframework.security.crypto.encrypt.TextEncryptor encryptor = org.springframework.security.crypto.encrypt.AndroidEncryptors.text(password, salt); String encryptedString = encryptor.encrypt("hello"); 在一次运行期间,encryptedString解析为“1ee3c42c9b986d30cd88da37f29bc3b9e93e3defdb76a2b23 72a47276152e2bd”。 然后将该字符串发布到运行在JDK 1.6.0_32上的tomcat 7服务器上的spring web应用程序(请注意JCE Unlimited Strength Jurisdiction策略文件已经安装)。 然后我尝试使用spring-security-crypto 3.2.0.RELEASE模块中的org.springframework.security.crypto.encrypt.Encryptors类来解密该字符串。 // naturally, the salt and password values used here are the same as the ones […]