Re: Encryption Functions?
Posted in 1994
->From: gcote@bnr.ca (Gary Cote) ->Subject: Encryption Functions? ->Date: 31 Jan 1994 11:28:26 -0600 ->Reply-To: gcote@bnr.ca (Gary Cote) ->Organization: Bell Northern Research, Richardson, TX -> ->I need to develop an encryption/decryption mechanism for password fields ->that will be stored in an Informix database. -> ->Because it will be stored in a database, the task is slightly complicated by the ->fact that I've got a fixed length that I can output and that the password can ->contain only a limited set of characters (must be printable, preferably non- ->punctuation). I'm not looking for state-of-the-art cryptology here, just ->something so that people don't have access to passwords through the database ->viewer. -> ->If any of you have done such before, please let me know and save me the effort. ->I'd greatly appreciate it. -> ->p.s. Pointers to public-domain source also desired. The solution needs to be ->"exportable" so no national security export-protected algorithms, please. ->-- ->gcote@bnr.ca | "What's this I hear of sorrow and weariness, ->Gary B. Cote | anger, discontent, and drooping hopes? ->Bell-Northern Research | Degenerate sons and daughters, ->Richardson, TX | life is too strong for you. -> | It takes life to love life." - Edgar Lee Masters -> -> I do not speak for my employers in any official capacity. Have you considered using a simple CRC algorithm on the input password value and then storing the resulting number as an integer? CRC (cyclic redundancy checksum, or some words similar) algorithms abound, and are certainly nothing the NSA could complain about. Integer results would always be printable. One simple example, with no promises made regarding robustness: LET pw_int = start_val { probably should be a prime number } FOR j = 1 TO LENGTH ( pw_char ) LET pw_int = pw_int * 3 + ord ( pw_char[1] ) + 1 END FOR This requires the use of the `ord' function, which is sadly lacking from the Informix tool kit. I posted a version last year, which I will mail direct to you, Gary, to save bandwidth. I enjoyed _Spoon_River_Anthology_; need to reread it sometime soon. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, SLS | / \\ alan@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\