加密是類似下面的方法,鹽值是在/data/data/com.android.providers.settings/databases/settings.db資料庫secure的表裡面,你檔案裡面看到的就是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(algo = "SHA-1").digest(saltedPassword);
byte[] md5 = MessageDigest.getInstance(algo = "MD5").digest(saltedPassword);
hashed = (toHex(sha1) + toHex(md5)).getBytes();
catch (NoSuchAlgorithmException e)
Log.w(TAG, "Failed to encode string because of missing algorithm: " + algo);
return hashed;
簡單來說就是sha1+MD5加鹽,這種加密方法目前無法破解
加密是類似下面的方法,鹽值是在/data/data/com.android.providers.settings/databases/settings.db資料庫secure的表裡面,你檔案裡面看到的就是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(algo = "SHA-1").digest(saltedPassword);
byte[] md5 = MessageDigest.getInstance(algo = "MD5").digest(saltedPassword);
hashed = (toHex(sha1) + toHex(md5)).getBytes();
}
catch (NoSuchAlgorithmException e)
{
Log.w(TAG, "Failed to encode string because of missing algorithm: " + algo);
}
return hashed;
}
簡單來說就是sha1+MD5加鹽,這種加密方法目前無法破解