From tskogan at common-lisp.net Sun Nov 7 00:17:35 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 01:17:35 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv3642/doc Modified Files: ChangeLog Log Message: See ChangeLog for details. Date: Sun Nov 7 01:17:34 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.1.1.1 crypticl/doc/ChangeLog:1.2 --- crypticl/doc/ChangeLog:1.1.1.1 Mon Sep 20 21:10:15 2004 +++ crypticl/doc/ChangeLog Sun Nov 7 01:17:34 2004 @@ -1,3 +1,13 @@ +06-11-2004 T?le Skogan + Cleaning up load. Completing renaming from CLC to Crypticl. + + * src/load.lisp: deleted. Functionality moved to crypticl-package.lisp. + Made each algorithm responsible for registering itself. + * src/common.lisp: Stop using factory method for individual classes of + algorithms (hash, cipher etc). They are all available from the common + interface new-instance. + * src/crypticl-package.lisp: Cleaning up load. + 09-09-2004 T?le Skogan Using max column 80. * doc/README: max column 80. From tskogan at common-lisp.net Sun Nov 7 00:17:47 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 01:17:47 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/aes.lisp crypticl/src/common.lisp crypticl/src/crypticl-package.lisp crypticl/src/des.lisp crypticl/src/diffie-hellman.lisp crypticl/src/dsa.lisp crypticl/src/idea.lisp crypticl/src/keygenerator.lisp crypticl/src/load.lisp crypticl/src/md5.lisp crypticl/src/numtheory.lisp crypticl/src/random.lisp crypticl/src/rsa.lisp crypticl/src/sha.lisp crypticl/src/test.lisp crypticl/src/utilities.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv3642/src Modified Files: aes.lisp common.lisp crypticl-package.lisp des.lisp diffie-hellman.lisp dsa.lisp idea.lisp keygenerator.lisp load.lisp md5.lisp numtheory.lisp random.lisp rsa.lisp sha.lisp test.lisp utilities.lisp Log Message: See ChangeLog for details. Date: Sun Nov 7 01:17:38 2004 Author: tskogan Index: crypticl/src/aes.lisp diff -u crypticl/src/aes.lisp:1.1.1.1 crypticl/src/aes.lisp:1.2 --- crypticl/src/aes.lisp:1.1.1.1 Mon Sep 20 21:13:27 2004 +++ crypticl/src/aes.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: AES ;;;; Author: T?le Skogan @@ -660,12 +660,12 @@ (error error-msg))) -(defun aes-test-suite-CLOS ( &optional verbosity) +(defun aes-test-suite-CLOS () (let* ((clear-org ;testing un-aligned, long data - "00112233445566778899aabbccddeeff00112233445566778899aabbccdd") - (key-org + "00112233445566778899aabbccddeeff00112233445566778899aabbccdd") + (key-org "000102030405060708090a0b0c0d0e0f") - (iv-org + (iv-org "01010101010101010101010101010101") (encrypted "a9541c06f1c21125e44013531e18f40682ffe0983d47361887c2b1d2a0bdf077") @@ -673,16 +673,12 @@ "a9541c06f1c21125e44013531e18f406") (final-encrypted "82ffe0983d47361887c2b1d2a0bdf077") - (CLC-verbose *CLC-verbose*) - - (aa (make-AES)) - (tmp nil) - (tmp2 nil) - (clear (hexo clear-org)) - (key (hexo key-org)) + (aa (make-AES)) + (tmp nil) + (tmp2 nil) + (clear (hexo clear-org)) + (key (hexo key-org)) (iv (hexo iv-org))) - - (setf *CLC-verbose* verbosity) ;Turn off debug msg (format t "~&Testing AES CLOS...") (formatv t "~&Clear text:~%~A" (hex clear)) @@ -717,7 +713,6 @@ (str-check (hex (concat tmp tmp2)) clear-org "AES decryption update + encrypt") - (setf *CLC-verbose* CLC-verbose) ;Restore verbosity level (format t "OK."))) @@ -736,26 +731,21 @@ (error "AES on FIPS 197 test vector")) (format t "OK.")))) -(defun aes-test-suite-long (&optional verbosity) +(defun aes-test-suite-long () "Testing long vector." (let ((aa (make-AES)) (tmp nil) (key (generate-key 'AES 128)) (iv #16(2)) - (clear #500(3)) - (CLC-verbose *CLC-verbose*)) - - (setf *CLC-verbose* verbosity) + (clear #500(3))) (format t "~&Testing AES long vector...") - (init-encrypt aa key :iv iv) (setf tmp (encrypt aa clear)) (init-decrypt aa key :iv iv) (setf tmp (decrypt aa tmp)) (assert (equalp tmp clear) () "AES long decryption and decryption") - (format t "OK.") - (setf *CLC-verbose* CLC-verbose))) ;Restore verbosity level)) + (format t "OK."))) (defun test-AES () (aes-test-suite-fips-197) @@ -794,7 +784,8 @@ - +(register-constructor 'AES #'make-AES) + Index: crypticl/src/common.lisp diff -u crypticl/src/common.lisp:1.1.1.1 crypticl/src/common.lisp:1.2 --- crypticl/src/common.lisp:1.1.1.1 Mon Sep 20 21:13:28 2004 +++ crypticl/src/common.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Common functionality. ;;;; Author: T?le Skogan @@ -11,6 +11,10 @@ (in-package crypticl) +(defun print-external-symbols () + (do-external-symbols (symbl *package* nil) + (print symbl))) + (defclass Crypto () ((algorithm :accessor algorithm :initarg :algorithm)) @@ -46,33 +50,11 @@ "Common super class for all signature algorithms")) -(defun make-Cipher-instance (algorithm) - (cond - ((string= algorithm "AES") (make-AES)) - ((string= algorithm "IDEA") (make-IDEA)) - (t (error "No such algorithm ~A" algorithm )))) - - -(defun make-Hash-instance (algorithm) - "Returns a hash object." - (cond - ((string= algorithm "SHA1") (make-SHA1)) - ((string= algorithm "MD5") (make-MD5)) - (t (error "No such algorithm ~A" algorithm )))) - -(defun make-Signature-instance (algorithm) - "Returns a hash object." - (cond - ((string= algorithm "DSA") (make-DSA)) - (t (error "No such algorithm ~A" algorithm )))) - - - ;; Designed for using symbols as keys. Use :test #'equal with strings. (defparameter *constructor-table* (make-hash-table :test #'equal)) (defun register-constructor (algorithm constructor) - "register on both string value and symbol value. To use symbol value from an external package, prefix with 'clc:, i.e. 'clc:AES" + "register on both string value and symbol value. To use symbol value from an external package, prefix with package name, i.e. 'crypticl:AES" (setf (gethash algorithm *constructor-table*) constructor) (setf (gethash (symbol-name algorithm) *constructor-table*) constructor)) @@ -91,7 +73,7 @@ "Main function for getting new instances of an algorithm. " (do ((fun (get-constructor algorithm) (get-constructor algorithm))) (fun (apply fun '())) - (restart-case (error "clc:new-instance: No such algorithm ~A implemented." algorithm) + (restart-case (error "new-instance: No such algorithm ~A implemented." algorithm) (store-value (value) :report "Try another algorithm." :interactive (lambda () @@ -105,7 +87,7 @@ (defun load-algorithm (&optional (path "des.lisp")) - "Dynamic loading of new algorithms. The protocol new code must follow is illustraded in the file CLC_des.lisp." + "Dynamic loading of new algorithms. The protocol new code must follow is illustraded in the file des.lisp." (compile-file path) (load path)) @@ -174,7 +156,7 @@ ;;;;;; ;;; MD5 ;; Included here to bypass compiler error when compiling the -;; md5-function-ffgghhii macro in CLC_md5.lisp. +;; md5-function-ffgghhii macro in md5.lisp. (defparameter *random-sine-table* (make-array 64 :element-type '(unsigned-byte 32) @@ -306,11 +288,11 @@ ;;;;;; ;;; DIV -(defparameter *CLC-verbose* nil) +(defparameter *verbose* nil) (defun formatv (&rest args) - "Handle arguments as format if *CLC-vervose is true" - (when *CLC-verbose* + "Act as format if verbosity is set" + (when *verbose* (apply #'format args))) Index: crypticl/src/crypticl-package.lisp diff -u crypticl/src/crypticl-package.lisp:1.1.1.1 crypticl/src/crypticl-package.lisp:1.2 --- crypticl/src/crypticl-package.lisp:1.1.1.1 Mon Sep 20 21:13:28 2004 +++ crypticl/src/crypticl-package.lisp Sun Nov 7 01:17:35 2004 @@ -56,16 +56,32 @@ print-external-symbols)) -(defun load-crypticl (&optional (location "")) - "Load the crypticl library. Default location is the current directory." - (let ((files '("load"))) +(in-package crypticl) + +(defun load-package (&optional (path "") (fast-load nil)) + "Load library. Default src location is current directory. If fast-load is true, do quick load without recompiling and running unit tests." + + (format t "Loading the Crypticl library...") + ;; NB! The order of the file names in the list matter. + (let ((files '("utilities" + "numtheory" + "common" + "sha" ;used by random + "random" + "keygenerator" + "md5" "aes" "idea" "dsa" "rsa" "diffie-hellman" + "test"))) (dolist (file files) - (let ((module (concatenate 'string location file))) - (compile-file-if-needed module) + (let ((module (concatenate 'string path file))) + (if fast-load + (excl::compile-file-if-needed module) + (compile-file module :verbose nil)) (load module))) - (crypticl:load-package location))) + (unless fast-load + (run-tests)))) + -(load-crypticl) +(load-package) Index: crypticl/src/des.lisp diff -u crypticl/src/des.lisp:1.1.1.1 crypticl/src/des.lisp:1.2 --- crypticl/src/des.lisp:1.1.1.1 Mon Sep 20 21:13:28 2004 +++ crypticl/src/des.lisp Sun Nov 7 01:17:35 2004 @@ -1,12 +1,12 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: A void DES implementation. ;;;; Author: T?le Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;; DES has not been implemented, but a DES class and some -;;; empty functions are included for use when testing dynamic loading. +;;; empty functions are included to test adding a new algorithm. (in-package crypticl) @@ -18,11 +18,9 @@ (make-instance 'DES)) (defmethod encrypt ((obj DES) &optional data (start 0) (end (length data))) - (list data start end) ;avoiding compiler warning - (format t "Entered DES encrypt")) + (declare (ignore start end))) (defun register-des () (register-constructor 'DES #'make-DES)) - (register-des) Index: crypticl/src/diffie-hellman.lisp diff -u crypticl/src/diffie-hellman.lisp:1.1.1.1 crypticl/src/diffie-hellman.lisp:1.2 --- crypticl/src/diffie-hellman.lisp:1.1.1.1 Mon Sep 20 21:13:29 2004 +++ crypticl/src/diffie-hellman.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Diffie-Hellman ;;;; Author: T?le Skogan @@ -57,6 +57,6 @@ (list s1 s2))) - +(register-constructor 'Diffie-Hellman #'make-Diffie-Hellman) Index: crypticl/src/dsa.lisp diff -u crypticl/src/dsa.lisp:1.1.1.1 crypticl/src/dsa.lisp:1.2 --- crypticl/src/dsa.lisp:1.1.1.1 Mon Sep 20 21:13:30 2004 +++ crypticl/src/dsa.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: The Digital Signature Algorithm (DSA). ;;;; Author: T?le Skogan @@ -207,6 +207,83 @@ (return k))))) +(defclass DSAPrivateKey (PrivateKey) + ((p :accessor p :initarg :p) + (q :accessor q :initarg :q) + (g :accessor g :initarg :g) + (x :accessor x :initarg :x) + (y :accessor y :initarg :y))) + +(defun make-DSAPrivateKey (p q g x y) + (make-instance 'DSAPrivateKey :p p :q q :g g :x x :y y :algorithm "DSA")) + +(defmethod string-rep ((obj DSAPrivateKey)) + (format nil "~A ~A ~A ~A ~A" (p obj) (q obj) (g obj) (x obj) (y obj))) + +(defmethod print-object ((obj DSAPrivateKey) stream) + (format stream "")) +;; Long output +;; (format stream "" (p obj) (q obj) (g obj) (x obj) (y obj))) + +(defclass DSAPublicKey (PublicKey) + ((p :accessor p :initarg :p) + (q :accessor q :initarg :q) + (g :accessor g :initarg :g) + (y :accessor y :initarg :y))) + +(defun make-DSAPublicKey (p q g y) + (make-instance 'DSAPublicKey :p p :q q :g g :y y :algorithm "DSA")) + +(defun make-DSAPublicKey-from-encoding (encoding) + (let ((lst (construct-from-encoding encoding 'DSA))) + (make-instance 'DSAPublicKey + :p (first lst) + :q (second lst) + :g (third lst) + :y (fourth lst) + :algorithm "DSA"))) + +(defun make-DSAPrivateKey-from-encoding (encoding) + (let ((lst (construct-from-encoding encoding 'DSA))) + (make-instance 'DSAPrivateKey + :p (first lst) + :q (second lst) + :g (third lst) + :x (fourth lst) + :y (fifth lst) + :algorithm "DSA"))) + +(defmethod string-rep ((obj DSAPublicKey)) + (format nil "~A ~A ~A ~A" (p obj) (q obj) (g obj) (y obj))) + +(defmethod print-object ((obj DSAPublicKey) stream) + (format stream "))")) + +;; Long output format +;; (format stream "" (p obj) (q obj) (g obj) (y obj))) + +(defclass DSAKeyPair (KeyPair) + ()) + +(defun make-DSAKeyPair (p q g x y) + (make-instance 'DSAKeyPair + :public (make-DSAPublicKey p q g y) + :private (make-DSAPrivateKey p q g x y))) + +(defun dsa-generate-keys () + "Return a DSAKeyPair" + (format t "~&Generating DSA keys, this may take some time...") + (let ((alg (make-DSA :defaultp t))) + (make-DSAKeyPair (p alg) (q alg) (g alg) (x alg) (y alg)))) + +(defmethod get-encoding ((obj DSAPublicKey)) + (get-element-encodings (list (p obj) (q obj) (g obj) (y obj)))) + +(defmethod get-encoding ((obj DSAPrivateKey)) + (get-element-encodings (list (p obj) (q obj) (g obj) (x obj) (y obj)))) + + + ;;;;;;; ;;; Test suite @@ -312,3 +389,4 @@ ;;; (values p q))) +(register-constructor 'DSA #'make-DSA) \ No newline at end of file Index: crypticl/src/idea.lisp diff -u crypticl/src/idea.lisp:1.1.1.1 crypticl/src/idea.lisp:1.2 --- crypticl/src/idea.lisp:1.1.1.1 Mon Sep 20 21:13:33 2004 +++ crypticl/src/idea.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: IDEA - International Data Encryption Algorithm ;;;; Author: T?le Skogan @@ -627,5 +627,5 @@ |# - +(register-constructor 'IDEA #'make-IDEA) Index: crypticl/src/keygenerator.lisp diff -u crypticl/src/keygenerator.lisp:1.1.1.1 crypticl/src/keygenerator.lisp:1.2 --- crypticl/src/keygenerator.lisp:1.1.1.1 Mon Sep 20 21:13:36 2004 +++ crypticl/src/keygenerator.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Key generation and key store. ;;;; Author: T?le Skogan @@ -24,7 +24,7 @@ ()) (defmethod print-object ((obj SymmetricKey) stream) - (format stream "" (hex (key obj)))) + (format stream "" (hex (key obj)))) (defclass AsymmetricKey (Key) ()) @@ -44,12 +44,6 @@ (defclass PrivateKey (AsymmetricKey) ()) - - - - - - (defclass Diffie-HellmanKey (Key) ((g :accessor g :initarg :g) (p :accessor p :initarg :p) @@ -86,87 +80,8 @@ (defmethod get-encoding ((obj Diffie-HellmanKey)) (get-element-encodings (list (g obj) (p obj)))) - - - - -(defclass DSAPrivateKey (PrivateKey) - ((p :accessor p :initarg :p) - (q :accessor q :initarg :q) - (g :accessor g :initarg :g) - (x :accessor x :initarg :x) - (y :accessor y :initarg :y))) - -(defun make-DSAPrivateKey (p q g x y) - (make-instance 'DSAPrivateKey :p p :q q :g g :x x :y y :algorithm "DSA")) - -(defmethod string-rep ((obj DSAPrivateKey)) - (format nil "~A ~A ~A ~A ~A" (p obj) (q obj) (g obj) (x obj) (y obj))) - -(defmethod print-object ((obj DSAPrivateKey) stream) - (format stream "")) -;; Long output -;; (format stream "" (p obj) (q obj) (g obj) (x obj) (y obj))) - -(defclass DSAPublicKey (PublicKey) - ((p :accessor p :initarg :p) - (q :accessor q :initarg :q) - (g :accessor g :initarg :g) - (y :accessor y :initarg :y))) - -(defun make-DSAPublicKey (p q g y) - (make-instance 'DSAPublicKey :p p :q q :g g :y y :algorithm "DSA")) - -(defun make-DSAPublicKey-from-encoding (encoding) - (let ((lst (construct-from-encoding encoding 'DSA))) - (make-instance 'DSAPublicKey - :p (first lst) - :q (second lst) - :g (third lst) - :y (fourth lst) - :algorithm "DSA"))) - -(defun make-DSAPrivateKey-from-encoding (encoding) - (let ((lst (construct-from-encoding encoding 'DSA))) - (make-instance 'DSAPrivateKey - :p (first lst) - :q (second lst) - :g (third lst) - :x (fourth lst) - :y (fifth lst) - :algorithm "DSA"))) - -(defmethod string-rep ((obj DSAPublicKey)) - (format nil "~A ~A ~A ~A" (p obj) (q obj) (g obj) (y obj))) - -(defmethod print-object ((obj DSAPublicKey) stream) - (format stream "))")) -;; Long output format -;; (format stream "" (p obj) (q obj) (g obj) (y obj))) - -(defclass DSAKeyPair (KeyPair) - ()) - -(defun make-DSAKeyPair (p q g x y) - (make-instance 'DSAKeyPair - :public (make-DSAPublicKey p q g y) - :private (make-DSAPrivateKey p q g x y))) - -(defun dsa-generate-keys () - "Return a DSAKeyPair" - (format t "~&Generating DSA keys, this may take some time...") - (let ((alg (make-DSA :defaultp t))) - (make-DSAKeyPair (p alg) (q alg) (g alg) (x alg) (y alg)))) - -(defmethod get-encoding ((obj DSAPublicKey)) - (get-element-encodings (list (p obj) (q obj) (g obj) (y obj)))) - -(defmethod get-encoding ((obj DSAPrivateKey)) - (get-element-encodings (list (p obj) (q obj) (g obj) (x obj) (y obj)))) - - (defclass RSAPublicKey (PublicKey) ((e :accessor e :initarg :e) ;public exponent @@ -179,7 +94,7 @@ (format nil "~A ~A" (e obj) (n obj))) (defmethod print-object ((obj RSAPublicKey) stream) - (format stream "" (e obj) (n obj))) + (format stream "" (e obj) (n obj))) (defclass RSAPrivateKey (PrivateKey) ((d :accessor d :initarg :d) ;private exponent @@ -206,7 +121,7 @@ (format nil "~A ~A" (d obj) (n obj))) (defmethod print-object ((obj RSAPrivateKey) stream) - (format stream "" (d obj) (n obj))) + (format stream "" (d obj) (n obj))) (defmethod get-encoding ((obj RSAPublicKey)) (get-element-encodings (list (e obj) (n obj)))) @@ -276,7 +191,7 @@ (make-DSAPrivateKey-from-encoding encoding)) ((or (equal type 'Diffie-HellmanKey) (string= type "Diffie-Hellman")) (make-Diffie-HellmanKey-from-encoding encoding)) - (t (error "clc:generate-key:Unknown algorithm=~S of type=~A" + (t (error "generate-key:Unknown algorithm=~S of type=~A" type (type-of type))))) ((or (equal type 'AES) (string= type "AES")) @@ -289,7 +204,7 @@ (dsa-generate-keys)) ((or (equal type 'Diffie-Hellman) (string= type "Diffie-Hellman")) (Diffie-Hellman-generate-key bitsize)) - (t (error "clc:generate-key:Cannot generate key of type ~A" type)))) + (t (error "generate-key:Cannot generate key of type ~A" type)))) @@ -584,3 +499,11 @@ (get-public-keys obj user))) +;; Register all key generators +(register-key-generator 'AES #'aes-generate-key) +(register-key-generator 'IDEA #'idea-generate-key) +(register-key-generator 'RSA #'rsa-generate-keys) +(register-key-generator 'DSA #'dsa-generate-keys) +(register-key-generator 'Diffie-Hellman #'Diffie-Hellman-generate-key) + +(register-constructor 'KeyStore #'make-KeyStore) \ No newline at end of file Index: crypticl/src/load.lisp diff -u crypticl/src/load.lisp:1.1.1.1 crypticl/src/load.lisp:1.2 --- crypticl/src/load.lisp:1.1.1.1 Mon Sep 20 21:13:37 2004 +++ crypticl/src/load.lisp Sun Nov 7 01:17:35 2004 @@ -8,69 +8,16 @@ ;;TO DO -(in-package crypticl) - -(defun load-package (&optional (prefix "")) - "Load library. Default src location is current directory." - (format t "Compiling, loading and testing the Crypticl library...") - ;; NB! The order of the file names in the list matter. - (let ((files '("utilities" - "numtheory" - "common" - "sha" ;used by random - "random" - "keygenerator" - "md5" "aes" "idea" "rsa" "dsa" "diffie-hellman" - "test"))) - (dolist (file files) - (let ((module (concatenate 'string prefix file))) - (compile-file module) - (load module))) - - (test-CLC) - - (register-CLC-constructors) - (register-CLC-key-generators))) - -(defun fast-load-package (&optional (prefix "")) - "Note that the order of the file names in the list 'files' matter. Loads without recompiling and testing." - (format t "Fast loading the Crypticl library...") - (let ((files '("utilities" - "numtheory" - "common" - "sha" ;used by random - "random" - "keygenerator" - "md5" "aes" "idea" "rsa" "dsa" "Diffie-Hellman" - "test"))) - (dolist (file files) - (let ((module (concatenate 'string prefix file))) - (excl::compile-file-if-needed module) - (load module))) - (register-CLC-constructors) - (register-CLC-key-generators))) -;; Register constructors -(defun register-CLC-constructors () - (register-constructor 'SHA1 #'make-SHA1) - (register-constructor 'MD5 #'make-MD5) - (register-constructor 'AES #'make-AES) - (register-constructor 'IDEA #'make-IDEA) - (register-constructor 'DSA #'make-DSA) - (register-constructor 'RSA #'make-RSA) - (register-constructor 'SHA1withRSA #'make-SHA1withRSA) - (register-constructor 'KeyStore #'make-KeyStore) - (register-constructor 'Diffie-Hellman #'make-Diffie-Hellman)) -;; Register key generators -(defun register-CLC-key-generators () - (register-key-generator 'AES #'aes-generate-key) - (register-key-generator 'IDEA #'idea-generate-key) - (register-key-generator 'RSA #'rsa-generate-keys) - (register-key-generator 'DSA #'dsa-generate-keys) - (register-key-generator 'Diffie-Hellman #'Diffie-Hellman-generate-key)) + + + + + + + + -(defun print-external-symbols () - (do-external-symbols (s 'clc nil) (print s))) \ No newline at end of file Index: crypticl/src/md5.lisp diff -u crypticl/src/md5.lisp:1.1.1.1 crypticl/src/md5.lisp:1.2 --- crypticl/src/md5.lisp:1.1.1.1 Mon Sep 20 21:13:39 2004 +++ crypticl/src/md5.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: The RSA MD5 message digest algorithm from Internet RFC 1321. ;;;; Author: T?le Skogan @@ -40,7 +40,7 @@ ;;;;;;; ;;; Low level MD5 functions -;; Also included in CLC_common.lisp to bypass compiler error when compiling +;; Also included in common.lisp to bypass compiler error when compiling ;; the md5-function-ffgghhii macro. (unless (boundp '*random-sine-table*) @@ -447,3 +447,6 @@ (md5-test 'MD5/long (list (list #9999(2) "a373b18167a1abd419ed333afec8ea32")))) + + +(register-constructor 'MD5 #'make-MD5) \ No newline at end of file Index: crypticl/src/numtheory.lisp diff -u crypticl/src/numtheory.lisp:1.1.1.1 crypticl/src/numtheory.lisp:1.2 --- crypticl/src/numtheory.lisp:1.1.1.1 Mon Sep 20 21:13:40 2004 +++ crypticl/src/numtheory.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Number theoretic utilities, including primality testing. ;;;; Author: T?le Skogan Index: crypticl/src/random.lisp diff -u crypticl/src/random.lisp:1.1.1.1 crypticl/src/random.lisp:1.2 --- crypticl/src/random.lisp:1.1.1.1 Mon Sep 20 21:13:41 2004 +++ crypticl/src/random.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Pseudo random number generation. ;;;; Author: T?le Skogan Index: crypticl/src/rsa.lisp diff -u crypticl/src/rsa.lisp:1.1.1.1 crypticl/src/rsa.lisp:1.2 --- crypticl/src/rsa.lisp:1.1.1.1 Mon Sep 20 21:13:44 2004 +++ crypticl/src/rsa.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: RSA encryption/decryption according to PKCS#1 ;;;; Author: T?le Skogan @@ -153,14 +153,14 @@ (defmethod init-encrypt ((obj RSA) key &key mode iv padding) "mode, iv and padding are only included for conformity with other Cipher objects and are not used." (when (or mode iv padding) - (warn "clc:Using mode(~A)/iv(~A)/padding(~A) makes no sense for RSA encrypt. These options will be ignored." + (warn "Using mode(~A)/iv(~A)/padding(~A) makes no sense for RSA encrypt. These options will be ignored." mode iv padding)) (init obj key :encryptp t )) (defmethod init-decrypt ((obj RSA) key &key mode iv padding) "mode, iv and padding are only included for conformity with other Cipher objects and are not used." (when (or mode iv padding) - (warn "clc:Using mode(~A)/iv(~A)/padding(~A) makes no sense for RSA decrypt. These options will be ignored." + (warn "Using mode(~A)/iv(~A)/padding(~A) makes no sense for RSA decrypt. These options will be ignored." mode iv padding)) (init obj key :encryptp nil)) @@ -418,3 +418,7 @@ (test prime1 exponent) (test prime2 exponent)) result)) + + +(register-constructor 'RSA #'make-RSA) +(register-constructor 'SHA1withRSA #'make-SHA1withRSA) \ No newline at end of file Index: crypticl/src/sha.lisp diff -u crypticl/src/sha.lisp:1.1.1.1 crypticl/src/sha.lisp:1.2 --- crypticl/src/sha.lisp:1.1.1.1 Mon Sep 20 21:13:46 2004 +++ crypticl/src/sha.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: The SHA-1 message digest algorithm. ;;;; Author: T?le Skogan @@ -398,3 +398,6 @@ "f4c046625d9c6672e0356bbe0ed5cd93adfa924b") () "sha1 test for long test vector 200000.") (format t "Done testing long vector.~%")))) + + +(register-constructor 'SHA1 #'make-SHA1) \ No newline at end of file Index: crypticl/src/test.lisp diff -u crypticl/src/test.lisp:1.1.1.1 crypticl/src/test.lisp:1.2 --- crypticl/src/test.lisp:1.1.1.1 Mon Sep 20 21:13:46 2004 +++ crypticl/src/test.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Test code for the library. ;;;; Author: T?le Skogan @@ -7,7 +7,7 @@ (in-package crypticl) -(defun test-dynamic-load (&key keystore (path "CLC_des.lisp")) +(defun test-dynamic-load (&key keystore (path "des.lisp")) "Testing dynamic loading of new algorithms." (let ((ks (or keystore (new-instance 'KeyStore))) (dsa (new-instance 'DSA)) @@ -47,7 +47,7 @@ (format t "Bad signature for file ~A, aborting load." path)))) -(defun test-CLC () +(defun run-tests() (test-SHA1) (test-MD5) (test-AES) Index: crypticl/src/utilities.lisp diff -u crypticl/src/utilities.lisp:1.1.1.1 crypticl/src/utilities.lisp:1.2 --- crypticl/src/utilities.lisp:1.1.1.1 Mon Sep 20 21:13:47 2004 +++ crypticl/src/utilities.lisp Sun Nov 7 01:17:35 2004 @@ -1,5 +1,5 @@ ;;;;-*-lisp-*- -;;;; The CLC cryptographic library. +;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Non-cryptopgrahic utilities ;;;; Author: T?le Skogan From tskogan at common-lisp.net Sun Nov 7 00:19:00 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 01:19:00 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/load.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv3848 Removed Files: load.lisp Log Message: Functionality moved to crypticl-package.lisp. Date: Sun Nov 7 01:19:00 2004 Author: tskogan From tskogan at common-lisp.net Sun Nov 7 12:04:17 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 13:04:17 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv18578/doc Modified Files: ChangeLog Log Message: Refactoring key generation. Date: Sun Nov 7 13:04:16 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.2 crypticl/doc/ChangeLog:1.3 --- crypticl/doc/ChangeLog:1.2 Sun Nov 7 01:17:34 2004 +++ crypticl/doc/ChangeLog Sun Nov 7 13:04:16 2004 @@ -1,3 +1,8 @@ +07-11-2004 T?le Skogan + Refactoring key generation. Put key generation code in each algorithm + and make the algorithm resonsible for registering the interface. + Put KeyStore in separate file. + 06-11-2004 T?le Skogan Cleaning up load. Completing renaming from CLC to Crypticl. From tskogan at common-lisp.net Sun Nov 7 12:04:31 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 13:04:31 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/keystore.lisp crypticl/src/aes.lisp crypticl/src/crypticl-package.lisp crypticl/src/diffie-hellman.lisp crypticl/src/dsa.lisp crypticl/src/idea.lisp crypticl/src/keygenerator.lisp crypticl/src/rsa.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv18578/src Modified Files: aes.lisp crypticl-package.lisp diffie-hellman.lisp dsa.lisp idea.lisp keygenerator.lisp rsa.lisp Added Files: keystore.lisp Log Message: Refactoring key generation. Date: Sun Nov 7 13:04:17 2004 Author: tskogan Index: crypticl/src/aes.lisp diff -u crypticl/src/aes.lisp:1.2 crypticl/src/aes.lisp:1.3 --- crypticl/src/aes.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/aes.lisp Sun Nov 7 13:04:17 2004 @@ -650,6 +650,11 @@ (update-and-decrypt obj data start end)) +(defun aes-generate-key (&optional (bitsize 128) encoding) + (declare (ignore encoding)) + (assert (member bitsize '(128 192 256)) () "AES invalid key size ~A" bitsize) + (generate-symmetric-key bitsize "AES")) + ;;;;;;; ;;; Test suite @@ -785,6 +790,7 @@ (register-constructor 'AES #'make-AES) +(register-key-generator 'AES #'aes-generate-key) Index: crypticl/src/crypticl-package.lisp diff -u crypticl/src/crypticl-package.lisp:1.2 crypticl/src/crypticl-package.lisp:1.3 --- crypticl/src/crypticl-package.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/crypticl-package.lisp Sun Nov 7 13:04:17 2004 @@ -3,9 +3,7 @@ ;;;; ;;;; Description: This file defines the crypticl package, the public interface ;;;; of the library. -;;;; Usage: Loading this file will call the funtion load-crypticl which again -;;;; loads the entire library. Unit tests will be run as part of the -;;;; loading. +;;;; Usage: Loading this file will load the rest of the library. ;;;; After loading you can list the public interface with ;;;; (crypticl:print-external-symbols) from the top-level. ;;;; Author: T?le Skogan @@ -42,6 +40,7 @@ load-package fast-load-package generate-key + key-from-encoding random-secure-octets public private @@ -70,6 +69,7 @@ "random" "keygenerator" "md5" "aes" "idea" "dsa" "rsa" "diffie-hellman" + "keystore" "test"))) (dolist (file files) (let ((module (concatenate 'string path file))) Index: crypticl/src/diffie-hellman.lisp diff -u crypticl/src/diffie-hellman.lisp:1.2 crypticl/src/diffie-hellman.lisp:1.3 --- crypticl/src/diffie-hellman.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/diffie-hellman.lisp Sun Nov 7 13:04:17 2004 @@ -35,7 +35,47 @@ (x (x (key obj)))) (mod-expt y x p))) + +;;;;;;;; +;;; Key generation + +(defclass Diffie-HellmanKey (Key) + ((g :accessor g :initarg :g) + (p :accessor p :initarg :p) + (x :accessor x :initarg :x))) + +(defmethod make-Diffie-HellmanKey (g p) + (make-instance 'Diffie-HellmanKey + :key nil + :g g + :p p + :algorithm "Diffie-Hellman")) + +(defun Diffie-Hellman-generate-key (bitsize) + (let ((p (random-bignum-max-odd bitsize))) + + (while (not (primep p)) + (setf p (random-bignum-max-odd bitsize))) + + ;; Find generator + (do ((g 2 (+ g 1))) + ((/= (mod-expt g p p) 1) (make-Diffie-HellmanKey g p))))) +(defun make-Diffie-HellmanKey-from-encoding (encoding) + (let ((lst (construct-from-encoding encoding 'Diffie-Hellman))) + (make-instance 'Diffie-HellmanKey + :key nil + :g (first lst) + :p (second lst) + :algorithm "Diffie-Hellman"))) + +(defmethod string-rep ((obj Diffie-HellmanKey)) + (format nil "~A ~A" (g obj) (p obj))) + +(defmethod get-encoding ((obj Diffie-HellmanKey)) + (get-element-encodings (list (g obj) (p obj)))) + + (defun test-dh () (let (y1 @@ -58,5 +98,6 @@ (register-constructor 'Diffie-Hellman #'make-Diffie-Hellman) - +(register-key-generator 'Diffie-Hellman #'Diffie-Hellman-generate-key) +(register-key-from-encoding 'Diffie-HellmanKey #'make-Diffie-HellmanKey-from-encoding) Index: crypticl/src/dsa.lisp diff -u crypticl/src/dsa.lisp:1.2 crypticl/src/dsa.lisp:1.3 --- crypticl/src/dsa.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/dsa.lisp Sun Nov 7 13:04:17 2004 @@ -29,6 +29,18 @@ (:documentation "A class for digital signatures using DSA. p and q are the primes, g the generator,x the private and y the public key.")) +(defclass DSAPrivateKey (PrivateKey) + ((p :accessor p :initarg :p) + (q :accessor q :initarg :q) + (g :accessor g :initarg :g) + (x :accessor x :initarg :x) + (y :accessor y :initarg :y))) + +(defclass DSAPublicKey (PublicKey) + ((p :accessor p :initarg :p) + (q :accessor q :initarg :q) + (g :accessor g :initarg :g) + (y :accessor y :initarg :y))) ;; Suiteable q and p (p 1024 bits) primes from the NIST DSA home page. (defparameter *DSA-default-q* @@ -207,12 +219,7 @@ (return k))))) -(defclass DSAPrivateKey (PrivateKey) - ((p :accessor p :initarg :p) - (q :accessor q :initarg :q) - (g :accessor g :initarg :g) - (x :accessor x :initarg :x) - (y :accessor y :initarg :y))) + (defun make-DSAPrivateKey (p q g x y) (make-instance 'DSAPrivateKey :p p :q q :g g :x x :y y :algorithm "DSA")) @@ -225,11 +232,7 @@ ;; Long output ;; (format stream "" (p obj) (q obj) (g obj) (x obj) (y obj))) -(defclass DSAPublicKey (PublicKey) - ((p :accessor p :initarg :p) - (q :accessor q :initarg :q) - (g :accessor g :initarg :g) - (y :accessor y :initarg :y))) + (defun make-DSAPublicKey (p q g y) (make-instance 'DSAPublicKey :p p :q q :g g :y y :algorithm "DSA")) @@ -389,4 +392,7 @@ ;;; (values p q))) -(register-constructor 'DSA #'make-DSA) \ No newline at end of file +(register-constructor 'DSA #'make-DSA) +(register-key-generator 'DSA #'dsa-generate-keys) +(register-key-from-encoding 'DSAPublicKey #'make-DSAPublicKey-from-encoding) +(register-key-from-encoding 'DSAPrivateKey #'make-DSAPrivateKey-from-encoding) \ No newline at end of file Index: crypticl/src/idea.lisp diff -u crypticl/src/idea.lisp:1.2 crypticl/src/idea.lisp:1.3 --- crypticl/src/idea.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/idea.lisp Sun Nov 7 13:04:17 2004 @@ -470,6 +470,14 @@ (update-and-decrypt obj data start end)) +;;;;;;;;;;; +;;; Key generation + +(defun idea-generate-key (&optional (bitsize 128) ) + (assert (member bitsize '(128)) () "IDEA invalid key size ~A" bitsize) + (generate-symmetric-key bitsize "IDEA")) + + ;;;;;;; ;;; Test suite @@ -628,4 +636,4 @@ (register-constructor 'IDEA #'make-IDEA) - +(register-key-generator 'IDEA #'idea-generate-key) Index: crypticl/src/keygenerator.lisp diff -u crypticl/src/keygenerator.lisp:1.2 crypticl/src/keygenerator.lisp:1.3 --- crypticl/src/keygenerator.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/keygenerator.lisp Sun Nov 7 13:04:17 2004 @@ -1,7 +1,7 @@ ;;;;-*-lisp-*- ;;;; The Crypticl cryptographic library. ;;;; -;;;; Description: Key generation and key store. +;;;; Description: Interface for key generation. ;;;; Author: T?le Skogan ;;;; Distribution: See the accompanying file LICENSE. @@ -44,168 +44,53 @@ (defclass PrivateKey (AsymmetricKey) ()) -(defclass Diffie-HellmanKey (Key) - ((g :accessor g :initarg :g) - (p :accessor p :initarg :p) - (x :accessor x :initarg :x))) - -(defmethod make-Diffie-HellmanKey (g p) - (make-instance 'Diffie-HellmanKey - :key nil - :g g - :p p - :algorithm "Diffie-Hellman")) - -(defun Diffie-Hellman-generate-key (bitsize) - (let ((p (random-bignum-max-odd bitsize))) - - (while (not (primep p)) - (setf p (random-bignum-max-odd bitsize))) - - ;; Find generator - (do ((g 2 (+ g 1))) - ((/= (mod-expt g p p) 1) (make-Diffie-HellmanKey g p))))) - -(defun make-Diffie-HellmanKey-from-encoding (encoding) - (let ((lst (construct-from-encoding encoding 'Diffie-Hellman))) - (make-instance 'Diffie-HellmanKey - :key nil - :g (first lst) - :p (second lst) - :algorithm "Diffie-Hellman"))) -(defmethod string-rep ((obj Diffie-HellmanKey)) - (format nil "~A ~A" (g obj) (p obj))) -(defmethod get-encoding ((obj Diffie-HellmanKey)) - (get-element-encodings (list (g obj) (p obj)))) - - - - -(defclass RSAPublicKey (PublicKey) - ((e :accessor e :initarg :e) ;public exponent - (n :accessor n :initarg :n))) ;modulus - -(defun make-RSAPublicKey (e n) - (make-instance 'RSAPublicKey :e e :n n :algorithm "RSA")) - -(defmethod string-rep ((obj RSAPublicKey)) - (format nil "~A ~A" (e obj) (n obj))) - -(defmethod print-object ((obj RSAPublicKey) stream) - (format stream "" (e obj) (n obj))) - -(defclass RSAPrivateKey (PrivateKey) - ((d :accessor d :initarg :d) ;private exponent - (n :accessor n :initarg :n))) - -(defun make-RSAPrivateKey (d n) - (make-instance 'RSAPrivateKey :d d :n n :algorithm "RSA")) - -(defun make-RSAPublicKey-from-encoding (encoding) - (let ((lst (construct-from-encoding encoding 'RSA))) - (make-instance 'RSAPublicKey - :e (first lst) - :n (second lst) - :algorithm "RSA"))) - -(defun make-RSAPrivateKey-from-encoding (encoding) - (let ((lst (construct-from-encoding encoding 'RSA))) - (make-instance 'RSAPrivateKey - :d (first lst) - :n (second lst) - :algorithm "RSA"))) - -(defmethod string-rep ((obj RSAPrivateKey)) - (format nil "~A ~A" (d obj) (n obj))) - -(defmethod print-object ((obj RSAPrivateKey) stream) - (format stream "" (d obj) (n obj))) - -(defmethod get-encoding ((obj RSAPublicKey)) - (get-element-encodings (list (e obj) (n obj)))) +(defun generate-symmetric-key (bitsize &optional algorithm) + (assert (= 0 (mod bitsize 8))) + (let ((octet-size (/ bitsize 8))) + (make-SymmetricKey (random-secure-octets octet-size) algorithm))) -(defmethod get-encoding ((obj RSAPrivateKey)) - (get-element-encodings (list (d obj) (n obj)))) -(defclass RSAKeyPair (KeyPair) - ()) +;; Can be used by lobo +(defgeneric key-from-encoding (keytype encoding)) -(defun make-RSAKeyPair (e d n) - (make-instance 'RSAKeyPair - :public (make-RSAPublicKey e n) - :private (make-RSAPrivateKey d n))) - -(defun aes-generate-key (&optional (bitsize 128) ) - (assert (member bitsize '(128 192 256)) () "AES invalid key size ~A" bitsize) - (generate-symmetric-key bitsize "AES")) - -(defun idea-generate-key (&optional (bitsize 128) ) - (assert (member bitsize '(128)) () "IDEA invalid key size ~A" bitsize) - (generate-symmetric-key bitsize "IDEA")) +(defmethod key-from-encoding ((keytype string) encoding) + "dispatch on keytype" + (do ((fun (get-key-from-encoding keytype) + (get-key-from-encoding keytype))) + (fun (apply fun (list encoding))) + (restart-case (error "No such keytype ~A implemented." keytype) + (store-value (value) + :report "Try another keytype." + :interactive + (lambda () + (format t "~&New keytype ") + (format + t "(use 'RSAPublicKey or RSAPublicKey, not \"RSAPublicKey\"): ") + (list (read))) + (typecase value + (cons (setf keytype (second value))) ;input format 'RSA + (symbol (setf keytype value))))))) + -(defun generate-symmetric-key (bitsize &optional algorithm) - (assert (= 0 (mod bitsize 8))) - (let ((octet-size (/ bitsize 8))) - (make-SymmetricKey (random-secure-octets octet-size) algorithm))) +(defparameter *key-from-encoding-table* (make-hash-table)) +(defun register-key-from-encoding (algorithm key-generator) + "The key generator function must accept one argument, an encoding. The encoding can be used to recreate a key." + ;; Store both symbol and symbol name + (setf (gethash algorithm *key-from-encoding-table*) key-generator) + (setf (gethash (symbol-name algorithm) + *key-from-encoding-table*) key-generator)) -(defun rsa-get-prime (bitsize e) - "Get a RSA prime n so that (n,e) = 1" - (do ((n (random-bignum-max-odd bitsize) - (random-bignum-max-odd bitsize))) - ((and (rsa-primep n) - (= 1 (gcd e (- n 1)))) - n))) - -(defun rsa-generate-keys (bitsize) - "Returns list with (public exponent, private exponent, modulus)" - (format t - "~&Generating ~A bits RSA keys, this may take some time..." bitsize) - (let* ((e 17) - (p (rsa-get-prime (floor bitsize 2) e)) - (q (rsa-get-prime (floor bitsize 2) e)) - (d (mod-inverse e (* (- p 1) (- q 1))))) - ;;(list e d p q (* p q)))) - (make-RSAKeyPair e d (* p q)))) - - - - -(defun generate-key (type &optional bitsize &key encoding) - "Ex: (generate-key 'AES 128)" - ;; NB! In Allegro string= handles both symbols and strings - (cond - (encoding - (cond - ((or (equal type 'RSAPublicKey) (string= type "RSAPublicKey")) - (make-RSAPublicKey-from-encoding encoding)) - ((or (equal type 'RSAPrivateKey) (string= type "RSAPrivateKey")) - (make-RSAPrivateKey-from-encoding encoding)) - ((or (equal type 'DSAPublicKey) (string= type "DSAPublicKey")) - (make-DSAPublicKey-from-encoding encoding)) - ((or (equal type 'DSAPrivateKey) (string= type "DSAPrivateKey")) - (make-DSAPrivateKey-from-encoding encoding)) - ((or (equal type 'Diffie-HellmanKey) (string= type "Diffie-Hellman")) - (make-Diffie-HellmanKey-from-encoding encoding)) - (t (error "generate-key:Unknown algorithm=~S of type=~A" - type (type-of type))))) - - ((or (equal type 'AES) (string= type "AES")) - (aes-generate-key bitsize)) - ((or (equal type 'IDEA) (string= type "IDEA")) - (idea-generate-key bitsize)) - ((or (equal type 'RSA) (string= type "RSA")) - (rsa-generate-keys bitsize)) - ((or (equal type 'DSA) (string= type "DSA")) - (dsa-generate-keys)) - ((or (equal type 'Diffie-Hellman) (string= type "Diffie-Hellman")) - (Diffie-Hellman-generate-key bitsize)) - (t (error "generate-key:Cannot generate key of type ~A" type)))) +(defun delete-key-from-encoding(algorithm) + (remhash algorithm *key-from-encoding-table*) + (remhash (symbol-name algorithm) *key-from-encoding-table*)) +(defun get-key-from-encoding (algorithm) + (gethash algorithm *key-from-encoding-table*)) @@ -213,16 +98,20 @@ (defparameter *key-generator-table* (make-hash-table)) (defun register-key-generator (algorithm key-generator) - (setf (gethash algorithm *key-generator-table*) key-generator)) + "The key generator function must accept one argument, a bitsize. The bitsize may be ignored (e.g. DSA)." + ;; Store both symbol and symbol name + (setf (gethash algorithm *key-generator-table*) key-generator) + (setf (gethash (symbol-name algorithm) + *key-generator-table*) key-generator)) (defun delete-key-generator(algorithm) - (remhash algorithm *key-generator-table*)) + (remhash algorithm *key-generator-table*) + (remhash (symbol-name algorithm) *key-generator-table*)) (defun get-key-generator (algorithm) (gethash algorithm *key-generator-table*)) - -(defun new-key (algorithm bitsize) +(defun generate-key (algorithm &optional bitsize) "Main function for getting new keys." (do ((fun (get-key-generator algorithm) (get-key-generator algorithm))) (fun (apply fun (list bitsize))) @@ -241,269 +130,3 @@ -;;;;;;; -;;; Key store - -;; Printed representation of KeyStore object -;; users: -;;( (("T?le Skogan" "tasko at stud.cs.uit.no"...) ("22ffee" "55aadd" ...)) -;; (("Ross Anderson" "ross at acm.org" ...) ("eeff34"..:))) -;; ht: -;; "22ffee" -> # - -(defclass KeyStore () - ((path :accessor path :initarg :path) - (users :accessor users :initform ()) - (ht :accessor ht :initform (make-hash-table :test #'equal)))) - -(defun handle-RSAPublicKey (tokens) - (make-RSAPublicKey (parse-integer (first tokens)) - (parse-integer (second tokens)))) - -(defun handle-RSAPrivateKey (tokens) - (make-RSAPrivateKey (parse-integer (first tokens)) - (parse-integer (second tokens)))) - -(defun handle-DSAPublicKey (tokens) - (make-DSAPublicKey (parse-integer (nth 0 tokens)) - (parse-integer (nth 1 tokens)) - (parse-integer (nth 2 tokens)) - (parse-integer (nth 3 tokens)))) - -(defun handle-DSAPrivateKey (tokens) - (make-DSAPrivateKey (parse-integer (nth 0 tokens)) - (parse-integer (nth 1 tokens)) - (parse-integer (nth 2 tokens)) - (parse-integer (nth 3 tokens)) - (parse-integer (nth 4 tokens)))) - -|# -"T?le Skogan" "tasko at stud.cs.uit.no" - first line -RSAPublicKey "22ffee" 5 119 - one line per key -RSAPrivateKey "22ffee" 77 119 -**** - separator between users -"Ron Rivest" "ron at acm.org" -RSAPublicKey "1234ffee" 3533 11413 -RSAPrivateKey "4321ffee" 6597 11413 -**** -#| - -(defun new-user (line) - (string= (string-trim " " line ) "****")) - -(defmethod put ((obj KeyStore) key-id key) - (setf (gethash key-id (ht obj)) key)) - -(defmethod insert-user ((obj KeyStore) names key-fingerprints) - (push (list names key-fingerprints) (users obj))) - -(defmethod find-entry ((obj KeyStore) names) - "Returns reference to entry where all names occur or nil." - (print names) - (dolist (entry (users obj)) - (print entry) - (when (subsetp names (first entry) :test #'string=) - (return entry)))) - -(defun get-int-fingerprint (int) - "Get fingerprint from integer. Uses the 64 least significant bits as in RFC 1991 (PGP)" - (hex-prepad-zero - (integer-to-octet-vector - (if (>= (integer-length int) 64) - (ldb (byte 64 0) int) - (ldb (byte (integer-length int) 0) int))) - 8)) - -(defmethod get-fingerprint ((obj Key)) - (etypecase obj - (DSAPublicKey (get-int-fingerprint (y obj))) - (DSAPublicKey (get-int-fingerprint (x obj))) - (RSAPublicKey (get-int-fingerprint (n obj))) - (RSAPrivateKey (get-int-fingerprint (n obj))))) - - - -(defun parse-user (obj stream usernames) - " -Stored as Lisp readable input: --RSAPublicKey ee23445566aabb e n --RSAPrivateKey 223344ddaaee23 d n -" - (let* ((names) - (key-fingerprints ())) - - ;; Parse user names in the first line - (let ((start 0)) - (loop - (multiple-value-bind (token end) - (read-from-string usernames nil 'eof :start start) - ;;(format t "~&Got:'~A' (start=~A, end=~A)" token start end) - (when (eq token 'eof) - (return)) ;break out of loop - (push (string token) names) - (setf start end)))) - - ;; Parse all key lines untill we reach a new user - (do ((line (read-line stream) (read-line stream nil 'eof))) - ((or (eq line 'eof) - (new-user line))) - - (let* ((tokens (split-string line " ")) - (type (read-from-string (first tokens))) ;make a token - (fingerprint (read-from-string (second tokens))) - (key-parts (cdr (cdr tokens))) - (key nil)) - (push fingerprint key-fingerprints) - - ;; Parse key parts and return a key object - (setf key - (case type - ('RSAPublicKey (handle-RSAPublicKey key-parts)) - ('RSAPrivateKey (handle-RSAPrivateKey key-parts)) - ('DSAPublicKey (handle-DSAPublicKey key-parts)) - ('DSAPrivateKey (handle-DSAPrivateKey key-parts)) - (t (error "~¬ a valid key type=~A" type)))) - (put obj fingerprint key))) - - (insert-user obj names key-fingerprints))) - - - - - - -(defmethod get-key ((obj KeyStore) fingerprint) - "Retrieves key" - (gethash fingerprint (ht obj))) - -|# -"T?le Skogan" "tasko at stud.cs.uit.no" - first line -RSAPublicKey "22ffee" 5 119 - one line per key -RSAPrivateKey "22ffee" 77 119 -**** - separator between users -"Ron Rivest" "ron at acm.org" -RSAPublicKey "1234ffee" 3533 11413 -RSAPrivateKey "4321ffee" 6597 11413 -**** -#| - -(defmethod write-to-file ((obj KeyStore) &optional (filename (path obj))) - (with-open-file (str filename :direction :output :if-exists :supersede) - (dolist (user (users obj)) - ;; First line with user name and aliases - (dolist (name (first user) (format str "~%")) - (format str "~w " name)) - - ;; Print each key - (dolist (fingerprint (second user) (format str "****~%")) - (let ((key (get-key obj fingerprint))) - (format str "~w ~w ~A~%" - (type-of key) fingerprint (string-rep key))))))) - - -(defmethod write-KeyStore ((obj KeyStore) &optional (filename (path obj))) - (with-open-file (str filename :direction :output :if-exists :supersede) - (dolist (user (users obj)) - ;; First line with user name and aliases - (dolist (name (first user) (format str "~%")) - (format str "~w " name)) - - ;; Print each key - (dolist (fingerprint (second user) (format str "****~%")) - (let ((key (get-key obj fingerprint))) - (format str "~w ~w ~A~%" - (type-of key) fingerprint (string-rep key))))))) - - -(defun print-entry (id key) - (print (list id key))) - -(defmethod print-object ((obj KeyStore) (str stream)) - (format str "~&Users:") - (print (users obj) str) - (format str "~&Keys:") - (maphash #'(lambda (fingerprint key) - (format str "~&~A ~A" fingerprint key)) - (ht obj))) - - - -(defun load-KeyStore (obj path) - "NB! If a key has multiple id it will be stored several times" - (with-open-file (str path :direction :input) - (when str - (do ((line (read-line str) (read-line str nil 'eof))) - ((eq line 'eof)) - (parse-user obj str line))))) - -;;;;;;; -;;; User level API - -(defmethod reset ((obj KeyStore)) - (setf (path obj) nil) - (clrhash (ht obj))) - -(defmethod init-KeyStore ((obj KeyStore) &optional (path "keystore.txt")) - "Init object with data from path." - (reset obj) - (load-KeyStore obj path)) - -(defun make-KeyStore (&optional (path "keystore.txt")) - (let ((obj (make-instance 'KeyStore :path path))) - (load-KeyStore obj path) - obj)) - -(defmethod add-key ((obj KeyStore) names key) - "Adds key to keystore with the given list of names as identifiers. If the names already exists, store the key under the existing entry." - (let ((fingerprint (get-fingerprint key)) - (entry (find-entry obj names))) - (format t "~&add-key: Found entry: ~A" entry) - - ;; Add fingerprint if not already present, else make new user - (if entry - (setf (nth 1 entry) (adjoin fingerprint (nth 1 entry) :test #'string=)) - (push (list names (list fingerprint)) (users obj))) - - ;; Insert key unless already there. - (unless (gethash fingerprint (ht obj)) - (put obj fingerprint key)))) - - - -(defmethod get-keys ((obj KeyStore) user) - (let ((fingerprints - (dolist (entry (users obj)) - (when (member user (first entry) :test #'(lambda (u e) - (string= u e))) - (return (second entry)))))) - (mapcar #'(lambda (fingerprint) - (get-key obj fingerprint)) - fingerprints))) - -(defmethod get-public-keys ((obj KeyStore) user) - (let ((fingerprints - (dolist (entry (users obj)) - (when (member user (first entry) :test #'(lambda (u e) - (string= u e))) - (return (second entry)))))) - (delete nil - (mapcar #'(lambda (fingerprint) - (let ((key (get-key obj fingerprint))) - (when (subtypep (class-of key) 'PublicKey) - key))) - fingerprints)))) - -(defmethod get-dsa-public-keys ((obj KeyStore) user) - (delete-if-not #'(lambda (x) - (subtypep (class-of x) 'DSAPublicKey)) - (get-public-keys obj user))) - - -;; Register all key generators -(register-key-generator 'AES #'aes-generate-key) -(register-key-generator 'IDEA #'idea-generate-key) -(register-key-generator 'RSA #'rsa-generate-keys) -(register-key-generator 'DSA #'dsa-generate-keys) -(register-key-generator 'Diffie-Hellman #'Diffie-Hellman-generate-key) - -(register-constructor 'KeyStore #'make-KeyStore) \ No newline at end of file Index: crypticl/src/rsa.lisp diff -u crypticl/src/rsa.lisp:1.2 crypticl/src/rsa.lisp:1.3 --- crypticl/src/rsa.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/rsa.lisp Sun Nov 7 13:04:17 2004 @@ -142,6 +142,16 @@ (leftover-count :accessor leftover-count ;number of unprocessed octets :initform 0))) +(defclass RSAPrivateKey (PrivateKey) + ((d :accessor d :initarg :d) ;private exponent + (n :accessor n :initarg :n))) + + +(defclass RSAPublicKey (PublicKey) + ((e :accessor e :initarg :e) ;public exponent + (n :accessor n :initarg :n))) ;modulus + + (defun make-RSA () "Constructor." (make-instance 'RSA :algorithm "RSA")) @@ -307,7 +317,85 @@ (if (vector-equal (decrypt cipher sig) hash) t nil))) - + + + + + +;;;;;; +;;; Key generation + + +(defun make-RSAPublicKey (e n) + (make-instance 'RSAPublicKey :e e :n n :algorithm "RSA")) + +(defmethod string-rep ((obj RSAPublicKey)) + (format nil "~A ~A" (e obj) (n obj))) + +(defmethod print-object ((obj RSAPublicKey) stream) + (format stream "" (e obj) (n obj))) + + + +(defun make-RSAPrivateKey (d n) + (make-instance 'RSAPrivateKey :d d :n n :algorithm "RSA")) + +(defun make-RSAPublicKey-from-encoding (encoding) + (let ((lst (construct-from-encoding encoding 'RSA))) + (make-instance 'RSAPublicKey + :e (first lst) + :n (second lst) + :algorithm "RSA"))) + +(defun make-RSAPrivateKey-from-encoding (encoding) + (let ((lst (construct-from-encoding encoding 'RSA))) + (make-instance 'RSAPrivateKey + :d (first lst) + :n (second lst) + :algorithm "RSA"))) + +(defmethod string-rep ((obj RSAPrivateKey)) + (format nil "~A ~A" (d obj) (n obj))) + +(defmethod print-object ((obj RSAPrivateKey) stream) + (format stream "" (d obj) (n obj))) + +(defmethod get-encoding ((obj RSAPublicKey)) + (get-element-encodings (list (e obj) (n obj)))) + +(defmethod get-encoding ((obj RSAPrivateKey)) + (get-element-encodings (list (d obj) (n obj)))) + + +(defclass RSAKeyPair (KeyPair) + ()) + +(defun make-RSAKeyPair (e d n) + (make-instance 'RSAKeyPair + :public (make-RSAPublicKey e n) + :private (make-RSAPrivateKey d n))) + + +(defun rsa-get-prime (bitsize e) + "Get a RSA prime n so that (n,e) = 1" + (do ((n (random-bignum-max-odd bitsize) + (random-bignum-max-odd bitsize))) + ((and (rsa-primep n) + (= 1 (gcd e (- n 1)))) + n))) + +(defun rsa-generate-keys (bitsize) + "Returns list with (public exponent, private exponent, modulus)" + (format t + "~&Generating ~A bits RSA keys, this may take some time..." bitsize) + (let* ((e 17) + (p (rsa-get-prime (floor bitsize 2) e)) + (q (rsa-get-prime (floor bitsize 2) e)) + (d (mod-inverse e (* (- p 1) (- q 1))))) + ;;(list e d p q (* p q)))) + (make-RSAKeyPair e d (* p q)))) + + ;;;;;;;;; ;;; Test suite @@ -421,4 +509,7 @@ (register-constructor 'RSA #'make-RSA) -(register-constructor 'SHA1withRSA #'make-SHA1withRSA) \ No newline at end of file +(register-constructor 'SHA1withRSA #'make-SHA1withRSA) +(register-key-generator 'RSA #'rsa-generate-keys) +(register-key-from-encoding 'RSAPublicKey #'make-RSAPublicKey-from-encoding) +(register-key-from-encoding 'RSAPrivateKey #'make-RSAPrivateKey-from-encoding) From tskogan at common-lisp.net Sun Nov 7 20:23:33 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 21:23:33 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog crypticl/doc/USERGUIDE Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv19395/doc Modified Files: ChangeLog USERGUIDE Log Message: Adding to USERGUIDE. code cleanup. Date: Sun Nov 7 21:23:32 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.3 crypticl/doc/ChangeLog:1.4 --- crypticl/doc/ChangeLog:1.3 Sun Nov 7 13:04:16 2004 +++ crypticl/doc/ChangeLog Sun Nov 7 21:23:32 2004 @@ -1,4 +1,7 @@ 07-11-2004 T?le Skogan + Adding to USERGUIDE. + +07-11-2004 T?le Skogan Refactoring key generation. Put key generation code in each algorithm and make the algorithm resonsible for registering the interface. Put KeyStore in separate file. Index: crypticl/doc/USERGUIDE diff -u crypticl/doc/USERGUIDE:1.1.1.1 crypticl/doc/USERGUIDE:1.2 --- crypticl/doc/USERGUIDE:1.1.1.1 Mon Sep 20 21:10:15 2004 +++ crypticl/doc/USERGUIDE Sun Nov 7 21:23:32 2004 @@ -7,6 +7,14 @@ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; +CONTENTS +======== +-Introduction +-Hash functions +-Symmetric key encryption +-Digital signatures + + INTRODUCTION ============ @@ -19,15 +27,19 @@ cl-user(3): (in-package crypticl) # +The examples use two utility functions, hex and hexo, to simplify the output. hex takes an octet vector (byte vector) and returns a string representation in hex. hexo is the reverse, it takes a hex string and returns the octect vector equivalent. Both functions are part of the library. + HASH FUNCTIONS ============== Create a SHA-1 object: -crypticl(4): (setf obj (make-SHA1)) +crypticl(4): (setf obj (new-instance 'SHA1)) # +The new-instance function is a factory method used to generate instances of all the algorithms. An md5 object can for example be created with (new-instance 'MD5). + Compute SHA-1 hash of a byte vector: crypticl(5): (hash obj #(97 98 99)) @@ -49,3 +61,165 @@ There is a semantic difference between calling hash on a hash object with no data and calling hash on an empty byte vector. Calling hash on an empty object is more likely to be a user error and hence returns nil. Calling hash on an empty byte vector on the other hand, may simply mean that we got very short input and hence returns the initial state of the SHA-1 algorithm (which is a valid 160 bits byte vector). + +The object oriented interface is built on top of low level function primitives for each algorithm. Sometimes it's easier to work directly with them. To get the SHA1 hash of a stream (typically a file) use sha1-on-octet-stream: + +crypticl(31): (with-open-file (s "rsa.lisp") + (hex (sha1-on-octet-stream s))) +"fe5f55ea902e3fd3b6875fb35c87c3f368d37660" + + + +SYMMETRIC KEY ENCRYPTION +======================== + +The Cipher class provides common functionality for symmetric and asymmetric +algorithms used for encryption. Subclasses of the Cipher class must support the following methods: + +init-encrypt: Initializes the Cipher object for encryption. Arguments may include the key and mode to use. + +init-decrypt: Initializes the Cipher object for decryption. Arguments may include the key and mode to use. + +update: Updates the state of the Cipher object. This means adding encrypted data for decryption or cleartext for encryption. + +encrypt: Applies padding and encrypts any leftover data. + +decrypt: Decrypts any leftover data and removes the padding. + +The class hierarchy looks like this: + +Crypto + -> Cipher + -> SymmetricCipher + -> AES + -> IDEA + -> AsymmetricCipher + -> RSA + -> Hash + -> SHA1 + -> MD5 + -> Signature + -> DSA + +To use a symmetric encryption scheme like IDEA or AES, start by getting an instance of the algorithm: + +crypticl(37): (setf obj (new-instance 'AES)) +# + +Then generate the key: + +crypticl(38): (setf aeskey (generate-key 'AES 128)) + + +Initialize the algorithm object for encryption with the key: + +crypticl(45): (init-encrypt obj aeskey) + +Than transform the cleartext to an octet-vector and encrypt it: + +crypticl(48): (hex (encrypt obj #(1 2 3))) +"b92a901ceb2d6da3f74cfafcc8bc4064" + +Note that although the input is only a 3 byte vector the output is a 16 byte long vector because of padding. To decrypt, initialize the object for decryption with the same key used for encryption and call decrypt: + +crypticl(49): (init-decrypt obj aeskey) + +crypticl(50): (decrypt obj (hexo "b92a901ceb2d6da3f74cfafcc8bc4064")) +#(1 2 3) + + +The next example is more advanced and sets both the iv and mode before doing encryption and decryption in several steps using the update function. + + +crypticl(126): (setf obj (new-instance 'AES)) +# +crypticl(129): (init-encrypt obj aeskey :mode 'cbc :iv #16(0)) +0 + +The CBC mode is the default mode and the only safe mode implemented. The default iv is #16(0). In the following we encrypt the input stream a bit at a time, a typical thing to do for large files or network streams. Each call to update returns the cryptotext for the section of cleartext given as input, minus possibly a residue modulo the block size. The encryption (or decryption) must be closed with a call to encrypt(decrypt). This call will empty any buffered cleartext from previous calls to update, add padding and return the last of the cryptotext. + +crypticl(131): (init-encrypt obj aeskey :mode 'cbc :iv #16(0)) +0 +crypticl(134): (hex (update obj #16(1))) +"3de24b30d69b6a0a607e0bb74016e0b0" +crypticl(135): (hex (update obj #7(2))) +"" + +This call didn't return any cryptotext because update didn't add enough cleartext to fill a whole block of cryptotext. + +crypticl(136): (hex (encrypt obj)) +"e32e05ea9f3d9c40c12431c3ef77afbb" +crypticl(137): (init-decrypt obj aeskey :mode 'cbc :iv #16(0)) +0 +crypticl(138): (hex (update obj (hexo "3de24b30d69b6a0a607e0bb74016e0b0"))) +"01010101010101010101010101010101" +crypticl(139): (hex (decrypt obj (hexo "e32e05ea9f3d9c40c12431c3ef77afbb"))) +"02020202020202" + + + +Digital signatures +================== +We create a DSA object and generate a keypair. We see that the keypair object contain a private key for signing data and a public key for verifying signatures. + +crypticl(148): (setf obj (new-instance 'DSA)) +# +crypticl(149): (setf dsakey (generate-key 'DSA)) +Generating DSA keys, this may take some time... +# +crypticl(150): :in dsakey +DSAKeyPair @ #x218390ba = # + 0 Class --------> # + 1 public -------> )) + 2 private ------> + + +Initialize the DSA object with the private key for signing: + +crypticl(155): (init-sign obj (private dsakey)) +... + +Sign the data. The sign function returns the signature as a list of two numbers: +crypticl(156): (setf signature (sign obj #16(1))) +(610205237490270933520572927751741211804151194981 + 814606745356376522186211750303275432244290651385) + +We can verify a singature by initializing the DSA object with the public key and give the data and the signature as input too verify: + +crypticl(158): (verify obj signature #16(1)) +t + + +Diffie-Hellman +============== + +The following functions illustrates the Diffie-Hellman interface. The result will be list with two secrets which should be equal. Each of the two Diffie-Hellman objects dh1 and dh2 represents the two endpoints in a secure exchange of a common secret. + +(defun test-dh () + (let (half-secret-1 + half-secret-2 + ;; secret-1 and secret-2 should be equal in the end + secret-1 + secret-2 + dh1 + dh2 + key-1 + key-1-copy) + + (setf dh1 (make-Diffie-Hellman)) + (setf dh2 (make-Diffie-Hellman)) + (setf key-1 (generate-key 'Diffie-Hellman 64)) + ;; Make a copy of the key. We need a copy because the init function + ;; stores state in the key object. + (setf key-1-copy (copy key-1)) + (init-Diffie-Hellman dh1 key-1) + (init-Diffie-Hellman dh2 key-1-copy) + (setf half-secret-1 (generate-random-Diffie-Hellman dh1)) + (setf half-secret-2 (generate-random-Diffie-Hellman dh2)) + (setf secret-1 (get-secret-Diffie-Hellman dh1 half-secret-2)) + (setf secret-2 (get-secret-Diffie-Hellman dh2 half-secret-1)) + (list secret-1 secret-2))) + + +crypticl(189): (test-dh) +(8431410348096402792 8431410348096402792) From tskogan at common-lisp.net Sun Nov 7 20:23:36 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 07 Nov 2004 21:23:36 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/crypticl-package.lisp crypticl/src/diffie-hellman.lisp crypticl/src/dsa.lisp crypticl/src/keygenerator.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv19395/src Modified Files: crypticl-package.lisp diffie-hellman.lisp dsa.lisp keygenerator.lisp Log Message: Adding to USERGUIDE. code cleanup. Date: Sun Nov 7 21:23:33 2004 Author: tskogan Index: crypticl/src/crypticl-package.lisp diff -u crypticl/src/crypticl-package.lisp:1.3 crypticl/src/crypticl-package.lisp:1.4 --- crypticl/src/crypticl-package.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/crypticl-package.lisp Sun Nov 7 21:23:33 2004 @@ -54,7 +54,7 @@ decrypt print-external-symbols)) - +;;(proclaim '(optimize (speed 2) (safety 1) (space 1) (debug 3))) (in-package crypticl) (defun load-package (&optional (path "") (fast-load nil)) Index: crypticl/src/diffie-hellman.lisp diff -u crypticl/src/diffie-hellman.lisp:1.3 crypticl/src/diffie-hellman.lisp:1.4 --- crypticl/src/diffie-hellman.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/diffie-hellman.lisp Sun Nov 7 21:23:33 2004 @@ -51,6 +51,9 @@ :p p :algorithm "Diffie-Hellman")) +(defmethod copy ((obj Diffie-HellmanKey)) + (make-Diffie-HellmanKey (g obj) (p obj))) + (defun Diffie-Hellman-generate-key (bitsize) (let ((p (random-bignum-max-odd bitsize))) @@ -78,23 +81,29 @@ (defun test-dh () - (let (y1 - y2 - s1 - s2 + (let (half-secret-1 + half-secret-2 + ;; secret-1 and secret-2 should be equal in the end + secret-1 + secret-2 dh1 dh2 - k1) + key-1 + key-1-copy) + (setf dh1 (make-Diffie-Hellman)) (setf dh2 (make-Diffie-Hellman)) - (setf k1 (generate-key "Diffie-Hellman" 64)) - (init-Diffie-Hellman dh1 k1) - (init-Diffie-Hellman dh2 k1) - (setf y1 (generate-random-Diffie-Hellman dh1)) - (setf y2 (generate-random-Diffie-Hellman dh2)) - (setf s1 (get-secret-Diffie-Hellman dh1 y2)) - (setf s2 (get-secret-Diffie-Hellman dh2 y1)) - (list s1 s2))) + (setf key-1 (generate-key 'Diffie-Hellman 64)) + ;; Make a copy of the key. We need a copy because the init function + ;; stores state in the key object. + (setf key-1-copy (copy key-1)) + (init-Diffie-Hellman dh1 key-1) + (init-Diffie-Hellman dh2 key-1-copy) + (setf half-secret-1 (generate-random-Diffie-Hellman dh1)) + (setf half-secret-2 (generate-random-Diffie-Hellman dh2)) + (setf secret-1 (get-secret-Diffie-Hellman dh1 half-secret-2)) + (setf secret-2 (get-secret-Diffie-Hellman dh2 half-secret-1)) + (list secret-1 secret-2))) (register-constructor 'Diffie-Hellman #'make-Diffie-Hellman) Index: crypticl/src/dsa.lisp diff -u crypticl/src/dsa.lisp:1.3 crypticl/src/dsa.lisp:1.4 --- crypticl/src/dsa.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/dsa.lisp Sun Nov 7 21:23:33 2004 @@ -50,11 +50,11 @@ (defun make-DSA (&key q pq-list generatep defaultp) - "Constructor for the DSA class. Note that this function is overloaded. Only one of the key word arguments should be used at a time.The default is to create an empty instance that can be initialized with the apropriate keys for signing or verifying. The typical usage will be to use init-verify with an authenticated copy of someone's public key to verify a document they have signed. + "Constructor for the DSA class. Note that this function is overloaded. Only one of the key word arguments should be used at a time. The default is to create an empty instance that can be initialized with the apropriate keys for signing or verifying. The typical usage will be to use init-verify with an authenticated copy of someone's public key to verify a document they have signed. -q: Will generate p and the rest of the key. -pq-list: A list containing primes q and p, where q|p-1. Will generate the rest of the key. Usefull for testing known primes given in the Digital Signature Standard documentation for example. --generatep: A boolean. Will genrate a new key pair." +-generatep: A boolean. Will generate a new key pair." (let (p g x (L 1024)) ;Modulus length (cond @@ -273,7 +273,8 @@ :public (make-DSAPublicKey p q g y) :private (make-DSAPrivateKey p q g x y))) -(defun dsa-generate-keys () +(defun dsa-generate-keys (bitsize) + (declare (ignore bitsize)) "Return a DSAKeyPair" (format t "~&Generating DSA keys, this may take some time...") (let ((alg (make-DSA :defaultp t))) Index: crypticl/src/keygenerator.lisp diff -u crypticl/src/keygenerator.lisp:1.3 crypticl/src/keygenerator.lisp:1.4 --- crypticl/src/keygenerator.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/keygenerator.lisp Sun Nov 7 21:23:33 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Interface for key generation. -;;;; Author: T?le Skogan +;;;; Author: T??le Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;TO DO @@ -76,7 +76,7 @@ (symbol (setf keytype value))))))) -(defparameter *key-from-encoding-table* (make-hash-table)) +(defparameter *key-from-encoding-table* (make-hash-table :test #'equalp)) (defun register-key-from-encoding (algorithm key-generator) "The key generator function must accept one argument, an encoding. The encoding can be used to recreate a key." @@ -95,7 +95,7 @@ -(defparameter *key-generator-table* (make-hash-table)) +(defparameter *key-generator-table* (make-hash-table :test #'equalp)) (defun register-key-generator (algorithm key-generator) "The key generator function must accept one argument, a bitsize. The bitsize may be ignored (e.g. DSA)." From tskogan at common-lisp.net Sat Nov 13 23:10:38 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 14 Nov 2004 00:10:38 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv17529/doc Modified Files: ChangeLog Log Message: Minor mods to get Obol runtime to load. Date: Sun Nov 14 00:10:37 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.4 crypticl/doc/ChangeLog:1.5 --- crypticl/doc/ChangeLog:1.4 Sun Nov 7 21:23:32 2004 +++ crypticl/doc/ChangeLog Sun Nov 14 00:10:36 2004 @@ -1,3 +1,6 @@ +14-11-2004 T?le Skogan + Minor modifications to get Obol runtime to load. + 07-11-2004 T?le Skogan Adding to USERGUIDE. From tskogan at common-lisp.net Sat Nov 13 23:10:43 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 14 Nov 2004 00:10:43 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/crypticl-package.lisp crypticl/src/dsa.lisp crypticl/src/keygenerator.lisp crypticl/src/rsa.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv17529/src Modified Files: crypticl-package.lisp dsa.lisp keygenerator.lisp rsa.lisp Log Message: Minor mods to get Obol runtime to load. Date: Sun Nov 14 00:10:39 2004 Author: tskogan Index: crypticl/src/crypticl-package.lisp diff -u crypticl/src/crypticl-package.lisp:1.4 crypticl/src/crypticl-package.lisp:1.5 --- crypticl/src/crypticl-package.lisp:1.4 Sun Nov 7 21:23:33 2004 +++ crypticl/src/crypticl-package.lisp Sun Nov 14 00:10:39 2004 @@ -14,6 +14,7 @@ (in-package cl-user) (defpackage crypticl + (:nicknames clc) (:use common-lisp) (:export get-secret-Diffie-Hellman @@ -82,6 +83,6 @@ (run-tests)))) -(load-package) +;;(load-package) Index: crypticl/src/dsa.lisp diff -u crypticl/src/dsa.lisp:1.4 crypticl/src/dsa.lisp:1.5 --- crypticl/src/dsa.lisp:1.4 Sun Nov 7 21:23:33 2004 +++ crypticl/src/dsa.lisp Sun Nov 14 00:10:39 2004 @@ -276,7 +276,6 @@ (defun dsa-generate-keys (bitsize) (declare (ignore bitsize)) "Return a DSAKeyPair" - (format t "~&Generating DSA keys, this may take some time...") (let ((alg (make-DSA :defaultp t))) (make-DSAKeyPair (p alg) (q alg) (g alg) (x alg) (y alg)))) Index: crypticl/src/keygenerator.lisp diff -u crypticl/src/keygenerator.lisp:1.4 crypticl/src/keygenerator.lisp:1.5 --- crypticl/src/keygenerator.lisp:1.4 Sun Nov 7 21:23:33 2004 +++ crypticl/src/keygenerator.lisp Sun Nov 14 00:10:39 2004 @@ -52,12 +52,7 @@ (make-SymmetricKey (random-secure-octets octet-size) algorithm))) - - -;; Can be used by lobo -(defgeneric key-from-encoding (keytype encoding)) - -(defmethod key-from-encoding ((keytype string) encoding) +(defun key-from-encoding (keytype encoding) "dispatch on keytype" (do ((fun (get-key-from-encoding keytype) (get-key-from-encoding keytype))) Index: crypticl/src/rsa.lisp diff -u crypticl/src/rsa.lisp:1.3 crypticl/src/rsa.lisp:1.4 --- crypticl/src/rsa.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/rsa.lisp Sun Nov 14 00:10:39 2004 @@ -386,8 +386,6 @@ (defun rsa-generate-keys (bitsize) "Returns list with (public exponent, private exponent, modulus)" - (format t - "~&Generating ~A bits RSA keys, this may take some time..." bitsize) (let* ((e 17) (p (rsa-get-prime (floor bitsize 2) e)) (q (rsa-get-prime (floor bitsize 2) e)) From tskogan at common-lisp.net Sun Nov 14 19:56:30 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 14 Nov 2004 20:56:30 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv21733/doc Modified Files: ChangeLog Log Message: Changing loading. Date: Sun Nov 14 20:56:27 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.5 crypticl/doc/ChangeLog:1.6 --- crypticl/doc/ChangeLog:1.5 Sun Nov 14 00:10:36 2004 +++ crypticl/doc/ChangeLog Sun Nov 14 20:56:27 2004 @@ -1,3 +1,7 @@ +15-11-2004 T?le Skogan + * src/crypticl-package.lisp: place load code in separate file. + * src/load.lisp: load function. + 14-11-2004 T?le Skogan Minor modifications to get Obol runtime to load. From tskogan at common-lisp.net Sun Nov 14 19:56:33 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Sun, 14 Nov 2004 20:56:33 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/load.lisp crypticl/src/crypticl-package.lisp crypticl/src/keystore.lisp crypticl/src/test.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv21733/src Modified Files: crypticl-package.lisp keystore.lisp test.lisp Added Files: load.lisp Log Message: Changing loading. Date: Sun Nov 14 20:56:30 2004 Author: tskogan Index: crypticl/src/load.lisp diff -u /dev/null crypticl/src/load.lisp:1.4 --- /dev/null Sun Nov 14 20:56:30 2004 +++ crypticl/src/load.lisp Sun Nov 14 20:56:29 2004 @@ -0,0 +1,42 @@ +;;;;-*-lisp-*- +;;;; The Crypticl cryptographic library. +;;;; +;;;; Description: Loads the library. +;;;; +;;;; Usage: Loading this file will load the rest of the library. +;;;; After loading you can list the public interface with +;;;; (crypticl:print-external-symbols) from the top-level. +;;;; Author: T??le Skogan +;;;; Distribution: See the accompanying file LICENSE. + +(in-package cl-user) + +;;(proclaim '(optimize (speed 2) (safety 1) (space 1) (debug 3))) + + +;; Load library. If fast-load is true, do quick load without recompiling. +;; NB! The order of the file names in the list matter. +(let ((fast-load t) + (files '("crypticl-package" + "utilities" + "numtheory" + "common" + "sha" ;used by random + "random" + "keygenerator" + "md5" "aes" "idea" "dsa" "rsa" "diffie-hellman" + "keystore" + "test"))) + (format t "Loading the Crypticl library...") + (dolist (file files) + (let* ((path + (make-pathname + :device (pathname-device *load-pathname*) + :directory (directory-namestring *load-pathname*))) + (module (merge-pathnames file path))) + (if fast-load + (excl::compile-file-if-needed module) + (compile-file module :verbose nil)) + (load module)))) + + Index: crypticl/src/crypticl-package.lisp diff -u crypticl/src/crypticl-package.lisp:1.5 crypticl/src/crypticl-package.lisp:1.6 --- crypticl/src/crypticl-package.lisp:1.5 Sun Nov 14 00:10:39 2004 +++ crypticl/src/crypticl-package.lisp Sun Nov 14 20:56:29 2004 @@ -55,34 +55,3 @@ decrypt print-external-symbols)) -;;(proclaim '(optimize (speed 2) (safety 1) (space 1) (debug 3))) -(in-package crypticl) - -(defun load-package (&optional (path "") (fast-load nil)) - "Load library. Default src location is current directory. If fast-load is true, do quick load without recompiling and running unit tests." - - (format t "Loading the Crypticl library...") - ;; NB! The order of the file names in the list matter. - (let ((files '("utilities" - "numtheory" - "common" - "sha" ;used by random - "random" - "keygenerator" - "md5" "aes" "idea" "dsa" "rsa" "diffie-hellman" - "keystore" - "test"))) - (dolist (file files) - (let ((module (concatenate 'string path file))) - (if fast-load - (excl::compile-file-if-needed module) - (compile-file module :verbose nil)) - (load module))) - - (unless fast-load - (run-tests)))) - - -;;(load-package) - - Index: crypticl/src/keystore.lisp diff -u crypticl/src/keystore.lisp:1.1 crypticl/src/keystore.lisp:1.2 --- crypticl/src/keystore.lisp:1.1 Sun Nov 7 13:04:17 2004 +++ crypticl/src/keystore.lisp Sun Nov 14 20:56:29 2004 @@ -43,7 +43,7 @@ (parse-integer (nth 3 tokens)) (parse-integer (nth 4 tokens)))) -|# +#| "T?le Skogan" "tasko at stud.cs.uit.no" - first line RSAPublicKey "22ffee" 5 119 - one line per key RSAPrivateKey "22ffee" 77 119 @@ -52,7 +52,7 @@ RSAPublicKey "1234ffee" 3533 11413 RSAPrivateKey "4321ffee" 6597 11413 **** -#| +|# (defun new-user (line) (string= (string-trim " " line ) "****")) @@ -142,7 +142,7 @@ "Retrieves key" (gethash fingerprint (ht obj))) -|# +#| "T?le Skogan" "tasko at stud.cs.uit.no" - first line RSAPublicKey "22ffee" 5 119 - one line per key RSAPrivateKey "22ffee" 77 119 @@ -151,7 +151,7 @@ RSAPublicKey "1234ffee" 3533 11413 RSAPrivateKey "4321ffee" 6597 11413 **** -#| +|# (defmethod write-to-file ((obj KeyStore) &optional (filename (path obj))) (with-open-file (str filename :direction :output :if-exists :supersede) Index: crypticl/src/test.lisp diff -u crypticl/src/test.lisp:1.2 crypticl/src/test.lisp:1.3 --- crypticl/src/test.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/test.lisp Sun Nov 14 20:56:29 2004 @@ -53,4 +53,6 @@ (test-AES) (test-RSA) (test-IDEA) - (test-DSA)) \ No newline at end of file + (test-DSA)) + +(run-tests) \ No newline at end of file From tskogan at common-lisp.net Tue Nov 23 21:19:21 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Tue, 23 Nov 2004 22:19:21 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog crypticl/doc/README Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv25741/doc Modified Files: ChangeLog README Log Message: New install instructions. Date: Tue Nov 23 22:19:18 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.6 crypticl/doc/ChangeLog:1.7 --- crypticl/doc/ChangeLog:1.6 Sun Nov 14 20:56:27 2004 +++ crypticl/doc/ChangeLog Tue Nov 23 22:19:17 2004 @@ -1,3 +1,6 @@ +23-11-2004 T?le Skogan + * doc/README: new install instructions. + 15-11-2004 T?le Skogan * src/crypticl-package.lisp: place load code in separate file. * src/load.lisp: load function. Index: crypticl/doc/README diff -u crypticl/doc/README:1.2 crypticl/doc/README:1.3 --- crypticl/doc/README:1.2 Mon Sep 20 21:30:33 2004 +++ crypticl/doc/README Tue Nov 23 22:19:18 2004 @@ -2,8 +2,7 @@ Crypticl is a library of cryptographic functions written in Common Lisp. The goal is to provide flexible, high level cryptographic abstractions on top of -a kernel of core cryptographic primitives. It is distributed under an -MIT-style license (see the LICENSE file). +a kernel of core cryptographic primitives. It is distributed under a MIT-style license (see the LICENSE file). The library will be limited to common, secure algorithms and not try to implement all available cryptographic algorithms. Hence AES is included and @@ -13,22 +12,23 @@ http://common-lisp.net/project/crypticl/ INSTALL -The library can be loaded by loading the file crypticl-package.lisp. This file - will call a function that loads the library and runs unit tests. The load -function by default assumes that the source is located in the current -directory. The default should be changed to fit applications using the library. +The library can be loaded by loading the file "load.lisp". This file + will load the library and run unit tests. -ex: (load "crypticl-package.lisp") +ex: (load "C:\\crypticl\\src\\load") -The library has only been tested on Allegro 6.2 and may by oversight still +The library has only been tested with Allegro 6.2 and may by oversight still contain some Allegro specific functions, but the bulk of the code should work -on all Common Lisp platforms. +on all Common Lisp implementations. DOCUMENTATION See the user guide in the file USERGUIDE. +DEVELOPERS +Document changes in the ChangeLog in addition to writing commit messages. Before commiting, check that the library loads correctly into a fresh top level (use (delete-package 'crypticl) and reload) and verify that the unit tests are successful. + CHANGELOG -See the file CHANGELOG for the project change log. +See the file ChangeLog for the project change log. CREDITS Tage Stabell-Kul? From tskogan at common-lisp.net Tue Nov 23 21:43:44 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Tue, 23 Nov 2004 22:43:44 +0100 Subject: [crypticl-cvs] CVS update: Module imported: obol Message-ID: Update of /project/crypticl/cvsroot/obol In directory common-lisp.net:/tmp/cvs-serv26937 Log Message: initial import Status: Vendor Tag: tskogan Release Tags: start N obol/doc/README N obol/doc/TODO N obol/src/chat.lisp N obol/src/lib-chat.lisp N obol/src/LICENSE N obol/src/load.lisp N obol/src/lobo.lisp N obol/src/packages.lisp N obol/src/util.lisp N obol/src/prog/chat-auth-a.obol N obol/src/prog/chat-auth-b.obol N obol/src/prog/chat-auth-s.obol N obol/src/prog/chat-receive.obol N obol/src/prog/chat-send.obol N obol/src/prog/Denning-Sacco-a.obol N obol/src/prog/Denning-Sacco-b.obol N obol/src/prog/Denning-Sacco-s.obol N obol/src/prog/DH.key N obol/src/prog/diffie-hellman.obol N obol/src/prog/dsapriv.key N obol/src/prog/dsapub.key N obol/src/prog/eke-a.obol N obol/src/prog/eke-b.obol N obol/src/prog/K512a-1.key N obol/src/prog/K512a.key N obol/src/prog/K512b-1.key N obol/src/prog/K512b.key N obol/src/prog/Kas.key N obol/src/prog/Kbs.key N obol/src/prog/kerberos-c.obol N obol/src/prog/kerberos-kdc.obol N obol/src/prog/kerberos-server.obol N obol/src/prog/Ks.key N obol/src/prog/Ku.key N obol/src/prog/lib-chat-auth-a.obol N obol/src/prog/lib-chat-auth-b.obol N obol/src/prog/lib-chat-auth-s.obol N obol/src/prog/lib-chat-receive.obol N obol/src/prog/lib-chat-send.obol N obol/src/prog/needham-schroeder-a.obol N obol/src/prog/needham-schroeder-b.obol N obol/src/prog/needham-schroeder-s.obol N obol/src/prog/otway-rees-a.obol N obol/src/prog/otway-rees-b.obol N obol/src/prog/otway-rees-s.obol N obol/src/prog/pgp-a.obol N obol/src/prog/pgp-b.obol N obol/src/prog/pgp-keyserver.obol N obol/src/prog/test.obol N obol/src/prog/wide-mouthed-frog-a.obol N obol/src/prog/wide-mouthed-frog-b.obol N obol/src/prog/wide-mouthed-frog-s.obol N obol/src/prog/yahalom-a.obol N obol/src/prog/yahalom-b.obol N obol/src/prog/yahalom-s.obol No conflicts created by this import Date: Tue Nov 23 22:43:43 2004 Author: tskogan New module obol added From tskogan at common-lisp.net Tue Nov 23 21:56:23 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Tue, 23 Nov 2004 22:56:23 +0100 Subject: [crypticl-cvs] CVS update: obol/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/obol/doc In directory common-lisp.net:/tmp/cvs-serv27787 Added Files: ChangeLog Log Message: Adding ChangeLog. Date: Tue Nov 23 22:56:21 2004 Author: tskogan From tskogan at common-lisp.net Wed Nov 24 08:27:33 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Wed, 24 Nov 2004 09:27:33 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog crypticl/doc/README Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv31173/doc Modified Files: ChangeLog README Log Message: Tagging version 0.1.0 and using tags in ChangeLog. Date: Wed Nov 24 09:27:31 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.7 crypticl/doc/ChangeLog:1.8 --- crypticl/doc/ChangeLog:1.7 Tue Nov 23 22:19:17 2004 +++ crypticl/doc/ChangeLog Wed Nov 24 09:27:31 2004 @@ -1,3 +1,8 @@ + +-------------------------------- 0.1.0 -------------------------------------- +24-11-2004 T?le Skogan + * doc/README: tag instructions. + 23-11-2004 T?le Skogan * doc/README: new install instructions. Index: crypticl/doc/README diff -u crypticl/doc/README:1.3 crypticl/doc/README:1.4 --- crypticl/doc/README:1.3 Tue Nov 23 22:19:18 2004 +++ crypticl/doc/README Wed Nov 24 09:27:31 2004 @@ -25,7 +25,7 @@ See the user guide in the file USERGUIDE. DEVELOPERS -Document changes in the ChangeLog in addition to writing commit messages. Before commiting, check that the library loads correctly into a fresh top level (use (delete-package 'crypticl) and reload) and verify that the unit tests are successful. +Document changes in the ChangeLog in addition to writing commit messages. Before commiting, check that the library loads correctly into a fresh top level (use (delete-package 'crypticl) and reload) and verify that the unit tests are successful. Tag with V___, like V_0_1_0, V_0_1_1, etc. CHANGELOG See the file ChangeLog for the project change log. From tstabell at common-lisp.net Wed Nov 24 22:54:38 2004 From: tstabell at common-lisp.net (Tage Stabell-Kulo) Date: Wed, 24 Nov 2004 23:54:38 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv16331/doc Modified Files: ChangeLog Log Message: Changed variable T to tmp and S tom Sbox. Date: Wed Nov 24 23:54:37 2004 Author: tstabell Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.8 crypticl/doc/ChangeLog:1.9 --- crypticl/doc/ChangeLog:1.8 Wed Nov 24 09:27:31 2004 +++ crypticl/doc/ChangeLog Wed Nov 24 23:54:36 2004 @@ -1,5 +1,8 @@ +2004-11-24 Tage Stabell-Kulo + + * src/sha1.lisp: Added more verbose printout. + * src/aes.lisp: Changed variable S to Sbox and T to tmp. --------------------------------- 0.1.0 -------------------------------------- 24-11-2004 T?le Skogan * doc/README: tag instructions. From tstabell at common-lisp.net Wed Nov 24 22:54:50 2004 From: tstabell at common-lisp.net (Tage Stabell-Kulo) Date: Wed, 24 Nov 2004 23:54:50 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/aes.lisp crypticl/src/load.lisp crypticl/src/sha.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv16331/src Modified Files: aes.lisp load.lisp sha.lisp Log Message: Changed variable T to tmp and S tom Sbox. Date: Wed Nov 24 23:54:40 2004 Author: tstabell Index: crypticl/src/aes.lisp diff -u crypticl/src/aes.lisp:1.3 crypticl/src/aes.lisp:1.4 --- crypticl/src/aes.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/aes.lisp Wed Nov 24 23:54:38 2004 @@ -63,7 +63,7 @@ 57 75 221 124 132 151 162 253 28 36 108 180 199 82 246 1) ) -(defconstant S +(defconstant Sbox #( 99 124 119 123 242 107 111 197 48 1 103 43 254 215 171 118 202 130 201 125 250 89 71 240 173 212 162 175 156 164 114 192 183 253 147 38 54 63 247 204 52 165 229 241 113 216 49 21 @@ -220,7 +220,7 @@ (ROUNDS (get-num-rounds (length key))) (tk (make-array (list 4 Nk))) (w (make-array (list (1+ ROUNDS) 4 NB))) - (T 0) + (tmp 0) (RCpointer 1) (key (change-key-format key Nk))) @@ -232,17 +232,17 @@ ;;Copy key into first slot in round key (for (col 0 Nk) (for (row 0 4) - (setf (aref w (floor T NB) row (mod T NB)) (aref tk row col))) - (incf T)) + (setf (aref w (floor tmp NB) row (mod tmp NB)) (aref tk row col))) + (incf tmp)) ;;Calculate as much round key material as we need. i counts 32 bits words. - (while (< T (* (1+ ROUNDS) NB)) + (while (< tmp (* (1+ ROUNDS) NB)) (for (i 0 4) (setf (aref tk i 0) (logxor (aref tk i 0) - (aref S (aref tk (mod (1+ i) 4) (1- Nk)))))) + (aref Sbox (aref tk (mod (1+ i) 4) (1- Nk)))))) (setf (aref tk 0 0) (logxor @@ -269,7 +269,7 @@ (setf (aref tk i 4) (logxor (aref tk i 4) - (aref S (aref tk i 3))))) + (aref Sbox (aref tk i 3))))) (for (j 5 Nk) (for (i 0 4) (setf (aref tk i j) @@ -280,9 +280,9 @@ ;;Copy values to round key (for (col 0 Nk) (for (row 0 4) - (setf (aref w (floor T NB) row (mod T NB)) + (setf (aref w (floor tmp NB) row (mod tmp NB)) (aref tk row col))) - (incf T))) + (incf tmp))) w)) @@ -303,14 +303,14 @@ (add-round-key state rk) (for (r 1 ROUNDS) - (sub-bytes state S) + (sub-bytes state Sbox) (shift-rows state t) (mix-columns state) (fill-rk r) (add-round-key state rk)) ;;Last round is special. No mix-columns - (sub-bytes state S) + (sub-bytes state Sbox) (shift-rows state t) (fill-rk ROUNDS) (add-round-key state rk)))) Index: crypticl/src/load.lisp diff -u crypticl/src/load.lisp:1.4 crypticl/src/load.lisp:1.5 --- crypticl/src/load.lisp:1.4 Sun Nov 14 20:56:29 2004 +++ crypticl/src/load.lisp Wed Nov 24 23:54:38 2004 @@ -9,6 +9,10 @@ ;;;; Author: T??le Skogan ;;;; Distribution: See the accompanying file LICENSE. +;;To-do: +;;-port this to non-Allegro lisps. excl: is Allegro spesific. Clisp +;; chokes on the Norwegian charachter in T??le (above). + (in-package cl-user) ;;(proclaim '(optimize (speed 2) (safety 1) (space 1) (debug 3))) Index: crypticl/src/sha.lisp diff -u crypticl/src/sha.lisp:1.2 crypticl/src/sha.lisp:1.3 --- crypticl/src/sha.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/sha.lisp Wed Nov 24 23:54:38 2004 @@ -47,6 +47,16 @@ (values (ldb (byte 32 32) message-length-in-bits) (ldb (byte 32 0) message-length-in-bits))) +(defun new-sha1-length64 (mess-len octet-vector start) + "Returns octet-vector after the interger mess-len has been encoded as eight bytes, high order bits first, starting at start" + (do ((char 56 (- char 8))) + ((> 0 char) + octet-vector) + (setf (aref octet-vector start) + (ldb (byte 8 char) mess-len)) + (incf start))) + + (defun sha-function-1 (x y z) (logior (logand x y)(logand (lognot x) z) )) @@ -372,7 +382,7 @@ "84983e441c3bd26ebaae4aa1f95129e5e54670f1") (list #300(2 2 2) "e697e7834a688d2c982003a312da660a17a0fc9d")))) - + (format t "Testing SHA-1.~%") (dolist (x test-list (format t "Short vectors OK.~%")) (let ((in (first x)) (ex (second x))) From tskogan at common-lisp.net Thu Nov 25 21:56:52 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Thu, 25 Nov 2004 22:56:52 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/ChangeLog crypticl/doc/README Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv29823/doc Modified Files: ChangeLog README Log Message: Removed allegro specific excl: function. Still one left. Using aa instead of the norwegian character ? in my name. Renamed various versions of TO DO: to To do: at the top of the files. Using TODO inside the source. Date: Thu Nov 25 22:56:49 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.9 crypticl/doc/ChangeLog:1.10 --- crypticl/doc/ChangeLog:1.9 Wed Nov 24 23:54:36 2004 +++ crypticl/doc/ChangeLog Thu Nov 25 22:56:49 2004 @@ -1,30 +1,41 @@ +25-11-2004 Taale Skogan + Removed allegro specific excl: function. Still one left. + Using aa instead of the norwegian character ? in my name. + Renamed various versions of TO DO: to To do: at the top of the files. + Using TODO inside the source. + + * src/*: naming and TODO + * src/load.lisp: removed excl: + 2004-11-24 Tage Stabell-Kulo * src/sha1.lisp: Added more verbose printout. * src/aes.lisp: Changed variable S to Sbox and T to tmp. -24-11-2004 T?le Skogan +--------------------------------- TAG 0.1.0 ------------------------------- + +24-11-2004 Taale Skogan * doc/README: tag instructions. -23-11-2004 T?le Skogan +23-11-2004 Taale Skogan * doc/README: new install instructions. -15-11-2004 T?le Skogan +15-11-2004 Taale Skogan * src/crypticl-package.lisp: place load code in separate file. * src/load.lisp: load function. -14-11-2004 T?le Skogan +14-11-2004 Taale Skogan Minor modifications to get Obol runtime to load. -07-11-2004 T?le Skogan +07-11-2004 Taale Skogan Adding to USERGUIDE. -07-11-2004 T?le Skogan +07-11-2004 Taale Skogan Refactoring key generation. Put key generation code in each algorithm and make the algorithm resonsible for registering the interface. Put KeyStore in separate file. -06-11-2004 T?le Skogan +06-11-2004 Taale Skogan Cleaning up load. Completing renaming from CLC to Crypticl. * src/load.lisp: deleted. Functionality moved to crypticl-package.lisp. @@ -34,6 +45,6 @@ interface new-instance. * src/crypticl-package.lisp: Cleaning up load. -09-09-2004 T?le Skogan +09-09-2004 Taale Skogan Using max column 80. * doc/README: max column 80. Index: crypticl/doc/README diff -u crypticl/doc/README:1.4 crypticl/doc/README:1.5 --- crypticl/doc/README:1.4 Wed Nov 24 09:27:31 2004 +++ crypticl/doc/README Thu Nov 25 22:56:49 2004 @@ -27,6 +27,9 @@ DEVELOPERS Document changes in the ChangeLog in addition to writing commit messages. Before commiting, check that the library loads correctly into a fresh top level (use (delete-package 'crypticl) and reload) and verify that the unit tests are successful. Tag with V___, like V_0_1_0, V_0_1_1, etc. +TODO +The file TODO is meant as a supplement to the various TODO comments in the source. + CHANGELOG See the file ChangeLog for the project change log. From tskogan at common-lisp.net Thu Nov 25 21:57:21 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Thu, 25 Nov 2004 22:57:21 +0100 Subject: [crypticl-cvs] CVS update: crypticl/src/aes.lisp crypticl/src/common.lisp crypticl/src/crypticl-package.lisp crypticl/src/des.lisp crypticl/src/diffie-hellman.lisp crypticl/src/dsa.lisp crypticl/src/idea.lisp crypticl/src/keygenerator.lisp crypticl/src/keystore.lisp crypticl/src/load.lisp crypticl/src/md5.lisp crypticl/src/numtheory.lisp crypticl/src/random.lisp crypticl/src/rsa.lisp crypticl/src/sha.lisp crypticl/src/test.lisp crypticl/src/utilities.lisp Message-ID: Update of /project/crypticl/cvsroot/crypticl/src In directory common-lisp.net:/tmp/cvs-serv29823/src Modified Files: aes.lisp common.lisp crypticl-package.lisp des.lisp diffie-hellman.lisp dsa.lisp idea.lisp keygenerator.lisp keystore.lisp load.lisp md5.lisp numtheory.lisp random.lisp rsa.lisp sha.lisp test.lisp utilities.lisp Log Message: Removed allegro specific excl: function. Still one left. Using aa instead of the norwegian character ? in my name. Renamed various versions of TO DO: to To do: at the top of the files. Using TODO inside the source. Date: Thu Nov 25 22:56:54 2004 Author: tskogan Index: crypticl/src/aes.lisp diff -u crypticl/src/aes.lisp:1.4 crypticl/src/aes.lisp:1.5 --- crypticl/src/aes.lisp:1.4 Wed Nov 24 23:54:38 2004 +++ crypticl/src/aes.lisp Thu Nov 25 22:56:51 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: AES -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;To do: Index: crypticl/src/common.lisp diff -u crypticl/src/common.lisp:1.2 crypticl/src/common.lisp:1.3 --- crypticl/src/common.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/common.lisp Thu Nov 25 22:56:52 2004 @@ -2,12 +2,13 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Common functionality. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;; TO DO: +;; To do: ;;-register constructors for byte-encoding constructors in the same way as for normal constructors. ;;-better spki string encoding with type. +;;-replace excl function (in-package crypticl) @@ -230,6 +231,7 @@ (defun get-element-encodings (msg-elements) "Get byte encoding for each msg element, transform to base64 spki and return the bytes." + ;;TODO replace excl function (excl:string-to-octets (to-spki (mapcar #'get-msg-element-encoding msg-elements)))) Index: crypticl/src/crypticl-package.lisp diff -u crypticl/src/crypticl-package.lisp:1.6 crypticl/src/crypticl-package.lisp:1.7 --- crypticl/src/crypticl-package.lisp:1.6 Sun Nov 14 20:56:29 2004 +++ crypticl/src/crypticl-package.lisp Thu Nov 25 22:56:52 2004 @@ -6,10 +6,10 @@ ;;;; Usage: Loading this file will load the rest of the library. ;;;; After loading you can list the public interface with ;;;; (crypticl:print-external-symbols) from the top-level. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;;TO DO +;;To do: (in-package cl-user) Index: crypticl/src/des.lisp diff -u crypticl/src/des.lisp:1.2 crypticl/src/des.lisp:1.3 --- crypticl/src/des.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/des.lisp Thu Nov 25 22:56:52 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: A void DES implementation. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;; DES has not been implemented, but a DES class and some Index: crypticl/src/diffie-hellman.lisp diff -u crypticl/src/diffie-hellman.lisp:1.4 crypticl/src/diffie-hellman.lisp:1.5 --- crypticl/src/diffie-hellman.lisp:1.4 Sun Nov 7 21:23:33 2004 +++ crypticl/src/diffie-hellman.lisp Thu Nov 25 22:56:52 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Diffie-Hellman -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. Index: crypticl/src/dsa.lisp diff -u crypticl/src/dsa.lisp:1.5 crypticl/src/dsa.lisp:1.6 --- crypticl/src/dsa.lisp:1.5 Sun Nov 14 00:10:39 2004 +++ crypticl/src/dsa.lisp Thu Nov 25 22:56:52 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: The Digital Signature Algorithm (DSA). -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;; Implementation based on the Digital Signature Standard (DSS) ([1]). @@ -10,7 +10,7 @@ ;;; ;;; [1] NIST. 2000. Digital Signature Standard (DSS). FIPS Pub 186-2. -;;TO DO: +;;To do: (in-package crypticl) Index: crypticl/src/idea.lisp diff -u crypticl/src/idea.lisp:1.3 crypticl/src/idea.lisp:1.4 --- crypticl/src/idea.lisp:1.3 Sun Nov 7 13:04:17 2004 +++ crypticl/src/idea.lisp Thu Nov 25 22:56:52 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: IDEA - International Data Encryption Algorithm -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;; Based on the references [1] and [2]. Index: crypticl/src/keygenerator.lisp diff -u crypticl/src/keygenerator.lisp:1.5 crypticl/src/keygenerator.lisp:1.6 --- crypticl/src/keygenerator.lisp:1.5 Sun Nov 14 00:10:39 2004 +++ crypticl/src/keygenerator.lisp Thu Nov 25 22:56:52 2004 @@ -2,10 +2,10 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Interface for key generation. -;;;; Author: T??le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;;TO DO +;;To do: (in-package crypticl) Index: crypticl/src/keystore.lisp diff -u crypticl/src/keystore.lisp:1.2 crypticl/src/keystore.lisp:1.3 --- crypticl/src/keystore.lisp:1.2 Sun Nov 14 20:56:29 2004 +++ crypticl/src/keystore.lisp Thu Nov 25 22:56:52 2004 @@ -2,15 +2,15 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Simple key store utility. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;;TO DO +;;To do: ;; Printed representation of KeyStore object ;; users: -;;( (("T?le Skogan" "tasko at stud.cs.uit.no"...) ("22ffee" "55aadd" ...)) +;;( (("Taale Skogan" "tasko at stud.cs.uit.no"...) ("22ffee" "55aadd" ...)) ;; (("Ross Anderson" "ross at acm.org" ...) ("eeff34"..:))) ;; ht: ;; "22ffee" -> # @@ -44,7 +44,7 @@ (parse-integer (nth 4 tokens)))) #| -"T?le Skogan" "tasko at stud.cs.uit.no" - first line +"Taale Skogan" "tasko at stud.cs.uit.no" - first line RSAPublicKey "22ffee" 5 119 - one line per key RSAPrivateKey "22ffee" 77 119 **** - separator between users @@ -143,7 +143,7 @@ (gethash fingerprint (ht obj))) #| -"T?le Skogan" "tasko at stud.cs.uit.no" - first line +"Taale Skogan" "tasko at stud.cs.uit.no" - first line RSAPublicKey "22ffee" 5 119 - one line per key RSAPrivateKey "22ffee" 77 119 **** - separator between users Index: crypticl/src/load.lisp diff -u crypticl/src/load.lisp:1.5 crypticl/src/load.lisp:1.6 --- crypticl/src/load.lisp:1.5 Wed Nov 24 23:54:38 2004 +++ crypticl/src/load.lisp Thu Nov 25 22:56:52 2004 @@ -6,22 +6,18 @@ ;;;; Usage: Loading this file will load the rest of the library. ;;;; After loading you can list the public interface with ;;;; (crypticl:print-external-symbols) from the top-level. -;;;; Author: T??le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;;To-do: -;;-port this to non-Allegro lisps. excl: is Allegro spesific. Clisp -;; chokes on the Norwegian charachter in T??le (above). +;;To do: (in-package cl-user) ;;(proclaim '(optimize (speed 2) (safety 1) (space 1) (debug 3))) -;; Load library. If fast-load is true, do quick load without recompiling. -;; NB! The order of the file names in the list matter. -(let ((fast-load t) - (files '("crypticl-package" +;; Load library. NB! The order of the file names in the list matter. +(let ((files '("crypticl-package" "utilities" "numtheory" "common" @@ -38,9 +34,7 @@ :device (pathname-device *load-pathname*) :directory (directory-namestring *load-pathname*))) (module (merge-pathnames file path))) - (if fast-load - (excl::compile-file-if-needed module) - (compile-file module :verbose nil)) + (compile-file module :verbose nil) (load module)))) Index: crypticl/src/md5.lisp diff -u crypticl/src/md5.lisp:1.2 crypticl/src/md5.lisp:1.3 --- crypticl/src/md5.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/md5.lisp Thu Nov 25 22:56:52 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: The RSA MD5 message digest algorithm from Internet RFC 1321. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;;; Credit: Low level code based on implementation by Mark Nahabedian with ;;;; enhancements by Tony Eng. Index: crypticl/src/numtheory.lisp diff -u crypticl/src/numtheory.lisp:1.2 crypticl/src/numtheory.lisp:1.3 --- crypticl/src/numtheory.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/numtheory.lisp Thu Nov 25 22:56:52 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Number theoretic utilities, including primality testing. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;; References: @@ -10,8 +10,7 @@ ;;; [2] Stinson,D.R. 2002. "Cryptography - Theory and Practice" ;;; [3] Rosen, K.H. 1993. "Elementary Number Theory" 3rd -;;TO DO - +;;To do: (in-package crypticl) Index: crypticl/src/random.lisp diff -u crypticl/src/random.lisp:1.2 crypticl/src/random.lisp:1.3 --- crypticl/src/random.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/random.lisp Thu Nov 25 22:56:52 2004 @@ -2,11 +2,11 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Pseudo random number generation. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;;TO DO +;;To do: ;;-get high entropy bits on non-Linux system. Either roll your own (most likely bad idea) or use win32API to handle one other system. But this is not important. win32 API CryptGenRandom. ;;-test suite. Some simple statistical tests on output? Index: crypticl/src/rsa.lisp diff -u crypticl/src/rsa.lisp:1.4 crypticl/src/rsa.lisp:1.5 --- crypticl/src/rsa.lisp:1.4 Sun Nov 14 00:10:39 2004 +++ crypticl/src/rsa.lisp Thu Nov 25 22:56:53 2004 @@ -2,13 +2,13 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: RSA encryption/decryption according to PKCS#1 -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. ;;; References: ;;; [1] RFC 2313 Kaliski, B. 1998. PKCS #1: RSA Encryption. -;;TO DO +;;To do: ;; - PKCS#1 parser is not correct for type 0 (but that is a poor byte type anyway ans is not likely to be used) (in-package crypticl) Index: crypticl/src/sha.lisp diff -u crypticl/src/sha.lisp:1.3 crypticl/src/sha.lisp:1.4 --- crypticl/src/sha.lisp:1.3 Wed Nov 24 23:54:38 2004 +++ crypticl/src/sha.lisp Thu Nov 25 22:56:53 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: The SHA-1 message digest algorithm. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. Index: crypticl/src/test.lisp diff -u crypticl/src/test.lisp:1.3 crypticl/src/test.lisp:1.4 --- crypticl/src/test.lisp:1.3 Sun Nov 14 20:56:29 2004 +++ crypticl/src/test.lisp Thu Nov 25 22:56:53 2004 @@ -2,7 +2,7 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Test code for the library. -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. (in-package crypticl) Index: crypticl/src/utilities.lisp diff -u crypticl/src/utilities.lisp:1.2 crypticl/src/utilities.lisp:1.3 --- crypticl/src/utilities.lisp:1.2 Sun Nov 7 01:17:35 2004 +++ crypticl/src/utilities.lisp Thu Nov 25 22:56:53 2004 @@ -2,10 +2,10 @@ ;;;; The Crypticl cryptographic library. ;;;; ;;;; Description: Non-cryptopgrahic utilities -;;;; Author: T?le Skogan +;;;; Author: Taale Skogan ;;;; Distribution: See the accompanying file LICENSE. -;;TO DO +;;To do: ;;-testvectors (in-package crypticl) From tskogan at common-lisp.net Thu Nov 25 21:59:08 2004 From: tskogan at common-lisp.net (Taale Skogan) Date: Thu, 25 Nov 2004 22:59:08 +0100 Subject: [crypticl-cvs] CVS update: crypticl/doc/TODO crypticl/doc/ChangeLog Message-ID: Update of /project/crypticl/cvsroot/crypticl/doc In directory common-lisp.net:/tmp/cvs-serv29895/doc Modified Files: ChangeLog Added Files: TODO Log Message: Added TODO file. Date: Thu Nov 25 22:59:06 2004 Author: tskogan Index: crypticl/doc/ChangeLog diff -u crypticl/doc/ChangeLog:1.10 crypticl/doc/ChangeLog:1.11 --- crypticl/doc/ChangeLog:1.10 Thu Nov 25 22:56:49 2004 +++ crypticl/doc/ChangeLog Thu Nov 25 22:59:05 2004 @@ -6,6 +6,8 @@ * src/*: naming and TODO * src/load.lisp: removed excl: + * doc/README: updated with TODO entry. + * doc/TODO: added file. 2004-11-24 Tage Stabell-Kulo