加密功能。 [英] An encrypting function.
问题描述
你好,
我需要加密功能,但还没有线索从哪里开始。
首先必须是一个字符串用两个不同的加密密钥加密。
两个输出都应该是z / AZ / 0-9,固定长度
(例如20个字符)。
(最好是加密密钥应该从字符串中选择字符我给它们b
,
以防止l和1',o''然后他们再次输入(比如$ _POST [''name'']和$ _POST [''code''])>
我必须解密它们。我知道$ _POST [''name'']应该使用
decode / encode-key 1,
和$ _POST [''code'']应该使用decode /编码键2.
解码它们应该再次相同。
(以下示例。)
我希望它'有点清楚...
问候卷曲。
--------示例--------
输入:foobar
输出键1:klKpUR867Biwr742gsBd
输出键2:9KdfnbDSnd65sgh45hsd
>
$ _POST [''name'']:klKpUR867Biwr742gsBd
$ _POST [''code'']:9KdfnbDSnd65sgh45hsd
结果:foobar ($ _POST [''name''] === $ _POST [''code''])
_POST [ ''name'']和
_POST [''code''])
我必须解密它们。我知道
_POST [''name'']应该使用
decode / encode-key 1,
和
Hi there,
I need an encrypting function, but haven''t got a clue where to start.
First a string has to be encrypted with two different encryption keys.
Both output should be anything a-z / A-Z / 0-9 with a fixed length
(e.g. 20 chars).
(Preferably the encryption keys should pick chars from a string i give
them,
to prevent l''s and 1''s, o''s and 0''s etc.)
Then they get inputted again ( say $_POST[''name''] and $_POST[''code''] )
and i have to decrypt them. I know $_POST[''name''] should use
decode/encode-key 1,
and $_POST[''code''] should use decode/encode-key 2.
Decoded they should be the same again.
(Example below.)
I hope it''s kind of clear ...
Greetings frizzle.
-------- EXAMPLE --------
Input : foobar
Output key 1 : klKpUR867Biwr742gsBd
Output key 2 : 9KdfnbDSnd65sgh45hsd
$_POST[''name''] : klKpUR867Biwr742gsBd
$_POST[''code''] : 9KdfnbDSnd65sgh45hsd
Result : foobar ( $_POST[''name''] === $_POST[''code''] )
_POST[''name''] and
_POST[''code''] )
and i have to decrypt them. I know
_POST[''name''] should use
decode/encode-key 1,
and
这篇关于加密功能。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!