home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- #
- # File: crypt.icn
- #
- # Subject: Program to encript file
- #
- # Author: Phil Bewig
- #
- # Date: May 5, 1992
- #
- ###########################################################################
- #
- # Do *not* use this in the face of competent cryptanalysis.
- #
- # usage: [iconx] icrypt [key] <infile >outfile
- #
- ############################################################################
- #
- # As written, uses UNIX-style console I/O.
- #
- ############################################################################
-
- procedure main(args)
- local i, k, ky, l, con
-
- if *args = 1 then
- ky := get(args)
- else {
- con := open("/dev/tty", "b")
- writes(con, "Enter password: ")
- # NOTE: displays password!
- ky := read(con)
- close(con) }
- i := 1
- l := 0
- k := []
- every put(k, ord(!ky)) do
- l +:= 1
- while writes(char(ixor(ord(reads()), k[i]))) do
- i %:= l + 1
- end
-
-