Path: csiph.com!goblin3!goblin.stu.neva.ru!panix!spencer From: David Spencer Newsgroups: comp.programming Subject: Re: string encryption Date: Wed, 28 Apr 2021 18:00:22 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 25 Message-ID: References: <1ba37dc7-803d-40ba-9e83-c4bd0b5f1394n@googlegroups.com> NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1619632822 20404 166.84.1.2 (28 Apr 2021 18:00:22 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 28 Apr 2021 18:00:22 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.programming:12508 David Brown writes: >On 28/04/2021 16:27, Malcolm McLean wrote: >> What's the best method for cheap and cheerful string encryption, >> which takes a plaintext string and a short string as a key, and >> returns a crypted string? The encrypted text must be a string, so >> the encryption must never create a nul character. It might also be >> best not to create ascii control characters, or non-ascii >> characters. >> >Any preferences for language? Some languages have such functions in >their standard libraries. Any need for standards or compatibility, or >is it just for your own use? >You could take your string as a list of bytes, step through it xor'ing >with the key string, then uuencode the result to get a string again. It >will be okay if you are only encrypting a few short strings with the >same key, and if there is no obvious known pattern in the strings to aid >cracking. Or he could do his own homework ... -- dhs spencer@panix.com