解密,md5 加密反应本机中的数据

decrypt ,md5 encrypt data in react native

我想知道在react native中如何解密,md5加密数据。你能帮帮我吗?我无法在网络上找到任何教程。我添加了用于加密的 md5 库,但我无法解密该鳕鱼。如果您也知道加密,请解释一下。我怎样才能在本机鳕鱼中使用。谢谢

MD5 is not an encryption algorithm! It is a message-digest algorithm used as a hash 函数。

Cryptographic hash 函数是 one-way、确定性、随机行为的压缩函数。

  • One-way表示不存在反函数,
  • 确定性意味着相同的输入导致相同的输出,
  • 压缩意味着输入大小可以是任意长度,但输出大小由散列函数固定。 MD5 的摘要大小为 128 位。
  • 随机是指哈希函数输出在计算前是不可预测的。

MD5 pre-image 阻力理论上被打破但实际上没有。而不是具有 2128 复杂度的通用原像攻击,有一个 attack that requires 2123.4 complexity. MD5, however, is not practically broken. You cannot reach the 123-bit search space in a meaningful time. Consider the collective power of BitCoin miners; in 2020/1/17 they reached 126.1314 Exahashes per second, 使得

  • 267 SHA256 秒双重哈希,
  • 292 一年中的 SHA256 双哈希。所以你需要 221 年才能拥有那个力量。

不过,你可以找到collisions for MD5. There are two good libraries two produce collisions; corkami or hashclash

对于加密,请使用具有适当模式的 AES 或 ChaCha20,例如 AES-GCM 或 AES-GCM-SIV,ChaCha20-Poly1305 机器人提供经过身份验证的加密,您将获得机密性、完整性和身份验证。