什么是创建可逆散列的好方法/函数? [英] What's a good method/function to create a reversible hash?

查看:234
本文介绍了什么是创建可逆散列的好方法/函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过网络传输一些数据,而且我不希望这些数据是纯文本。



我发送的文本需要颠倒过来我不能md5 / sha256 / etc ...
$ b $

编码咸字符串的好方法是什么?

加密。



您使用的是哪种语言?您可能有一个可以使用的内置加密算法。






使用散列法的想法是,您只能去一个

  [纯文本] --->(哈希算法) - >哈希



加密的想法是您可以使用和一些明文一起创建密文。然后,您可以随时使用密文上的密钥来检索明文:

  [纯文本] + [键]  - (加密算法) - > [密文] 
[密文] + [密钥] --->(解密算法) - > [纯文本]

给定加密算法的解密算法通常与加密算法非常相似,并且它允许检索给定的明文消息一个密文和正确的密钥(即密码)。


I need to transmit some data over the wire and I don't want that data being plain text.

The text I'm sending needs to be reversed so I can't md5/sha256/etc...

What's a good way to encode a salted string?

解决方案

You're looking for encryption.

What language are you using? You probably have a built-in encryption algorithm you can use.


The idea with hashing is that you can only go one-way.

[plain text]--->(HASH ALGORITHM)--->HASH


Whereas the idea with encryption is that you can use a key together with some plaintext to create a ciphertext. Then you can use the key on the ciphertext to retrieve the plaintext at any time:

[plain text] + [key] --->(ENCRYPTION ALGORITHM)-->[ciphertext]
[ciphertext] + [key] --->(DECRYPTION ALGORITHM)-->[plain text]

The decryption algorithm for a given encryption algorithm is usually very similar to the encryption algorithm, and it allows for the retrieval of a plaintext message given a ciphertext and the correct key (ie password).

这篇关于什么是创建可逆散列的好方法/函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆