You are here: Re: Polyalphabetic encryption for Passwords « PHP Programming Language « IT news, forums, messages
Re: Polyalphabetic encryption for Passwords

Posted by Sjoerd on 02/17/06 15:11

Jeremy Deuel wrote:
> Just an Idea:
> In PHP, passwords for different purposes often are stored plaintext in
> the source. I often wondered, how this could be prevented.

Nice functions, and not that simple to decrypt.

People already thought about this, and came up with the following:
XOR "encryption": A bitwise XOR (exclusive or, ^ operator) is done for
every character of the string. The key is repeated, as in your example.
The advantage is that encryption and decryption uses the same function:
Doing a XOR on a string twice will result in the original string.
ROT-13: Rotate the alphabet with 13 positions: A becomes N, B becomes
O, etc. Because there are 26 letters in the alphabet, doing a ROT-13
twice will result in the original string.

Also take a look at str_repeat(), which can repeat the key so that it
is long enough. You can use the % operator instead of fmod().

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация