From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8947310381c2a3f X-Google-Attributes: gid103376,public From: John Howard Subject: Re: Ada & Encryption / Compression Date: 1997/03/05 Message-ID: #1/1 X-Deja-AN: 223397584 References: <5fikh7$ras$1@nargun.cc.uq.edu.au> To: David Downie Organization: SkyNET Corporation Newsgroups: comp.lang.ada Date: 1997-03-05T00:00:00+00:00 List-Id: On 5 Mar 1997, David Downie wrote: > I am thinking about writing an RSA encryption (or some other encryption) > package. I would like to do it in Ada (rather than the suggested C), but > am not an Ada expert and do not know if I would just be making things > difficult for myself. > > Has anyone had any similar (bit level) experience and can comment or > perhaps point me somewhere? Forget about doing your own RSA encryption. 1) RSA is patented. You'd have to wait for the patent to expire. 2) RSA can't be implemented unless you know the two large prime numbers it uses (which are a secret). As of a year ago, RSA was still not reported as cracked to reveal the two primes. Presumably many skilled researchers have tried to crack RSA. Forget about doing your own LZW compression. 1) Lempel-Ziv Welch is not public domain. LZW is used in GIF, TIFF, and Adobe PDF formats. 2) Lempel-Ziv Huffman (LZH) is public domain. 3) Run Length Encoding (RLE) is public domain. See: Digital Cash (Commerce on the Net), by Peter Wayner. Publ. by Academic Press, 1996. PP. 271, Softcover, ISBN 0-12-738763-3. [List: $34.95] One chapter explains RSA and DES and other schemes. More an introductory overview but with enough details for implementation by a programmer who is equiped from elsewhere with large primes. Differential Cryptanalysis of the Data Encryption Standard, by E. Biham & A. Shamir. Publ. by Springer-Verlag, 1993. PP. 188, Hardcover, ISBN 0-387-97930-1. [List: $42.95, (North America only) sale price: $34.50 ends March 14; www.springer-ny.com] Tells how to crack some DES variants. Useful to anyone implementing a sophisticated encryption scheme. Alternatively, you can locate and download the Turbo Pascal sources from SWAG (source ware archive group). It has a few simple encryption and compression examples. You could recode these as filters for Ada 95 streams. (SWAG IS SEVERAL MEGABYTES UNCOMPRESSED) Lastly there is stream specific source code in Turbo Pascal (not related to SWAG). Filename: streams13.zip or higher. Streams implements about a dozen filters and a few perform simple encryption or compression. Translating a couple Turbo Pascal filters into Ada 95 filters is feasible for an intermediate-level programmer. [For simple encryption use a filter employing XOR operation and a linear congruential "random" number generator based upon the position within the stream and the direction state. This allows for encryption while moving backward or forward within the stream. For sophisticated encryption use a DES variant as a filter. For loss-less compression use LZH and RLE as filters.] -- John Howard -- Team Ada Team OS/2 --