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.
精彩评论