Modify usage of blowfish encryption to match new design in which
authorChris Hanson <org/chris-hanson/cph>
Mon, 9 Aug 1999 03:26:14 +0000 (03:26 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 9 Aug 1999 03:26:14 +0000 (03:26 +0000)
header manipulation handles the init-vector.

v7/src/edwin/dosfile.scm
v7/src/edwin/filcom.scm
v7/src/edwin/unix.scm

index c51da04fcb40d11503d8f3d9c2147d1ec5cd6a45..3ff3a01a3511bb1479832ade5eaa80c943076e53 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: dosfile.scm,v 1.27 1999/05/21 04:31:57 cph Exp $
+;;; $Id: dosfile.scm,v 1.28 1999/08/09 03:25:51 cph Exp $
 ;;;
 ;;; Copyright (c) 1994-1999 Massachusetts Institute of Technology
 ;;;
@@ -608,10 +608,11 @@ filename suffixes \".bf\" and \".ky\"."
     (cond ((equal? "bf" type)
           (call-with-binary-input-file pathname
             (lambda (input)
-              (read-blowfish-file-header input)
               (call-with-output-mark mark
                 (lambda (output)
-                  (blowfish-encrypt-port input output password #f))))))
+                  (blowfish-encrypt-port input output password
+                                         (read-blowfish-file-header input)
+                                         #f))))))
          ((or (equal? "ky" type) (equal? "KY" type))
           (insert-string (let ((the-encrypted-file
                                 (call-with-binary-input-file pathname
@@ -644,8 +645,9 @@ filename suffixes \".bf\" and \".ky\"."
                                          (region-end region))))
             (call-with-binary-output-file pathname
               (lambda (output)
-                (write-blowfish-file-header output)
-                (blowfish-encrypt-port input output password #t)))))
+                (blowfish-encrypt-port input output password
+                                       (write-blowfish-file-header output)
+                                       #t)))))
          ((or (equal? "ky" type) (equal? "KY" type))
           (let ((the-encrypted-file
                  (encrypt (extract-string (region-start region)
index c8943a6f4e9a6df9d51befc8449fff548a40c2c8..3197d6411af990241ac142e67e952cc5a8ecd708 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: filcom.scm,v 1.201 1999/01/29 04:50:01 cph Exp $
+;;; $Id: filcom.scm,v 1.202 1999/08/09 03:25:20 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
 ;;;
@@ -636,8 +636,9 @@ Deletes the plaintext file after encryption."
             (lambda (input)
               (call-with-binary-output-file to
                 (lambda (output)
-                  (write-blowfish-file-header output)
-                  (blowfish-encrypt-port input output password #t))))))
+                  (blowfish-encrypt-port input output password
+                                         (write-blowfish-file-header output)
+                                         #t))))))
          (delete-file from)))))
 
 (define-command decrypt-file
@@ -663,13 +664,14 @@ Prefix arg means treat the plaintext file as binary data."
        (let ((password (prompt-for-password "Password")))
          (call-with-binary-input-file from
            (lambda (input)
-             (read-blowfish-file-header input)
              ((if binary?
                   call-with-binary-output-file
                   call-with-output-file)
               to
               (lambda (output)
-                (blowfish-encrypt-port input output password #f)))))))))
+                (blowfish-encrypt-port input output password
+                                       (read-blowfish-file-header input)
+                                       #f)))))))))
 \f
 ;;;; Prompting
 
index c810cb4963204d9b85526a60f1b1943101fa1167..5f7d49934718801a925d6a89d9c63e0eefeaaf49 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: unix.scm,v 1.95 1999/06/06 18:26:46 cph Exp $
+;;; $Id: unix.scm,v 1.96 1999/08/09 03:26:14 cph Exp $
 ;;;
 ;;; Copyright (c) 1989-1999 Massachusetts Institute of Technology
 ;;;
@@ -472,10 +472,11 @@ filename suffixes \".bf\" and \".ky\"."
     (cond ((equal? "bf" type)
           (call-with-binary-input-file pathname
             (lambda (input)
-              (read-blowfish-file-header input)
               (call-with-output-mark mark
                 (lambda (output)
-                  (blowfish-encrypt-port input output password #f))))))
+                  (blowfish-encrypt-port input output password
+                                         (read-blowfish-file-header input)
+                                         #f))))))
          ((or (equal? "ky" type) (equal? "KY" type))
           (insert-string (let ((the-encrypted-file
                                 (call-with-binary-input-file pathname
@@ -508,8 +509,9 @@ filename suffixes \".bf\" and \".ky\"."
                                          (region-end region))))
             (call-with-binary-output-file pathname
               (lambda (output)
-                (write-blowfish-file-header output)
-                (blowfish-encrypt-port input output password #t)))))
+                (blowfish-encrypt-port input output password
+                                       (write-blowfish-file-header output)
+                                       #t)))))
          ((or (equal? "ky" type) (equal? "KY" type))
           (let ((the-encrypted-file
                  (encrypt (extract-string (region-start region)