开发者

Simple XOR (PHP & C#)

is it possible to have some sort of very simple reversible encryption in php that can be reversed using C开发者_运维百科# Winforms?

thank you


Yes. Algorithms are not language specific.


Sure. In the PHP part you can use the bitwise operator ^, but you'll first have to convert the string into an array of integers (e.g. array_map('ord', str_split($str))) and then do an inner product with the one-time pad, xor taking the role of multiplication and concatenation taking the role of addition.

Remember that if you re-use the pad, the security of the encryption falls apart.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜