Article View: comp.os.ms-windows.programmer.tools
Article #935Re: Password encryption/de-cryption
From: Renato Ghica
Date: Wed, 09 Aug 1995 19:51
Date: Wed, 09 Aug 1995 19:51
31 lines
1656 bytes
1656 bytes
In article <409ska$9pc@speedy.cci.de>, Alistair Priest <alistair@cci.de> writes:
|> shah@wg.com wrote:
|> >I am developing a windows 3.1 app. This app needs to authenticate a user
[snip]
|> Here is some code to do it! The basic principle is simply to multiply
|> the ASCII code for each letter by the weighting in the string. This can
|> not return you the old string (ie. its one-way), so it is more secure.
|> However more than 1 password may have the same number after encrypting.
|> Hope this helps
|>
|>
|> #include <stdio.h>
|>
|> void main()
|> {
|> int total = 0;
|> char password[20];
|> int i;
|>
|> gets(password);
|> for (i = 0; i < strlen(password); total += password[i] * i++);
|> printf("Encrypted value is %d\n", total);
|> }
|>
Hmm.. This doesn't seem to encrypt *ONE* character passwords very well.
password = "A", total = 'A'.
-rg
Technical Details
Message-ID:
<40b3k0$s8@mallard.ftn.us-ny.citicorp.com>Path:
arc1-ca.pugleaf.net!citicorp.com!ghicaReferences:
<NEWTNews.807898837.21140.shah@shah.wg.com> <409ska$9pc@speedy.cci.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!citicorp.com!ghica From: ghica@fig.citib.com (Renato Ghica) Newsgroups: comp.os.ms-windows.programmer.tools,comp.os.ms-windows.programmer.networks,comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.controls,comp.os.ms-windows.apps.utilities,comp.os.ms-windows.apps.misc,comp.os.ms-windows.apps.comm,comp.lang.c++ Subject: Re: Password encryption/de-cryption Date: 9 Aug 1995 15:51:28 -0400 Organization: Citibank IBISM Sender: ghica@mallard.ftn.us-ny.citicorp.com Distribution: world Message-ID: <40b3k0$s8@mallard.ftn.us-ny.citicorp.com> References: <NEWTNews.807898837.21140.shah@shah.wg.com> <409ska$9pc@speedy.cci.de> NNTP-Posting-Host: mallard.ftn.us-ny.citicorp.com