%%s 3/3/67 %%d D 1.2 15-Jun-83 10:47:20 sventek 2 1 %%c Removed trailing periods from quoted strings, as they are no longer needed. %%s 0/0/0 %%d D 1.1 25-Mar-82 12:03:09 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 %%D 2 #-h- crypt.r 934 asc 25-mar-82 07:31:15 v1.1 (sw-tools v1.1) %%E 2 %%I 2 #-h- crypt.r 937 asc 15-jun-83 10:47:06 sventek (joseph sventek) %%E 2 #-h- defns 56 asc 25-mar-82 07:30:51 v1.1 (sw-tools v1.1) # definitions for crypt tool define(MAXKEY,MAXLINE) %%D 2 #-h- main 538 asc 25-mar-82 07:30:52 v1.1 (sw-tools v1.1) %%E 2 %%I 2 #-h- main 537 asc 15-jun-83 10:46:44 sventek (joseph sventek) %%E 2 # crypt - encrypt and decrypt standard input DRIVER(crypt) character getc, xor character c, key(MAXKEY), b integer getarg, mod integer i, keylen %%D 2 string usestr "usage: crypt key." %%E 2 %%I 2 string usestr "usage: crypt key" %%E 2 call query(usestr) keylen = getarg(1,key,MAXKEY) if (keylen == EOF) call error(usestr) for (i=1; getc(c) != EOF; i = mod(i,keylen) + 1) { if (c < ' ') #leave control characters alone call putc(c) else { b = xor(c, key(i) & 31) if (b == 127) #DEC can't handle RUBOUT char b = c call putc(b) } } DRETURN end #-h- xor 121 asc 25-mar-82 07:30:55 v1.1 (sw-tools v1.1) # xor - exclusive-or of a and b character function xor(a,b) character a, b xor = (a & !b) | (!a & b) return end #-h- crypt.fmt 873 asc 25-mar-82 07:31:18 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Crypt (1) 15-Jan-79 crypt and decrypt standard input .sy crypt key .ds crypt encrypts characters on the standard input by using 'key'. The file can eventually be decrypted by running it back through crypt with the same key. Double encryption (encrypting a file with first one key and then another) is allowable, but on some systems the decryption must be done in the exact reverse order as encryption was done. The encryption algorithm used by 'crypt' is not a complicated one, so users requiring a great degree of protection should not rely on this tool. .fl none .sa .di .au Original from Kernighan & Plauger's 'Software Tools', with modifications by Debbie Scherrer. (NOTE: the original encryption algorithm has been altered slightly.) .bu On IAS and VMS systems, double encryption must be decrypted in the exact reverse order as the encryption. %%E 1