sha1加密解密 安卓手機字符密碼加密方式有哪些?
安卓手機字符密碼加密方式有哪些?加密與以下方法類似,salt值位于/data/data/com.android.providers網站.設置/數(shù)據庫/設置.db在數(shù)據庫安全表中,您在文件中看到的是SH
安卓手機字符密碼加密方式有哪些?
加密與以下方法類似,salt值位于/data/data/com.android.providers網站.設置/數(shù)據庫/設置.db在數(shù)據庫安全表中,您在文件中看到的是SHA1 MD5的值:(40位,32位)
public byte[]passwordtohash(string password)
{
if(password==null)
{
return null]}
]string algo=null
byte[]hashed=null
try
{
byte[]saltedPassword=(password getSalt()).getBytes()
byte[]sha1=MessageDigest.getInstance消息摘要(算法=“SHA-1”。摘要(saltedPassword)
字節(jié)[]md5=MessageDigest.getInstance消息摘要(algo=“MD5”).digest(saltedPassword)
hashed=(toHex(sha1)toHex(MD5)).getBytes()
}
catch(nosuchalgorithme)
{
Log.w(TAG,”無法對字符串進行編碼,因為缺少算法:“algo
}
return hashed
}簡單地說,就是在SHA1 MD5中加鹽,目前還不能破解