小编Abd*_*nan的帖子

密码加密模式不安全,如何解决?

我正在加密登录密码firebase,它运行良好,但我在 google play 控制台中收到一条警告,your app contains unsafe cryptographic encryption patterns我该如何摆脱它?

我正在 android studio 上尝试。

public static class AESCrypt
{
    private static final String ALGORITHM = "AES";
    private static final String KEY = "1Hbfh667adfDEJ78";

    public static String encrypt(String value) throws Exception
    {
        Key key = generateKey();
        Cipher cipher = Cipher.getInstance(AESCrypt.ALGORITHM);
        cipher.init(Cipher.ENCRYPT_MODE, key);
        byte [] encryptedByteValue = cipher.doFinal(value.getBytes("utf-8"));
        String encryptedValue64 = Base64.encodeToString(encryptedByteValue, Base64.DEFAULT);
        return encryptedValue64;

    }

    public static String decrypt(String value) throws Exception
    {
        Key key = generateKey(); …
Run Code Online (Sandbox Code Playgroud)

java android firebase-authentication

5
推荐指数
1
解决办法
6147
查看次数

标签 统计

android ×1

firebase-authentication ×1

java ×1