From d8fe40a545d5bce8b4352e03c17c6e5e430e5604 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 9 Aug 1999 03:26:14 +0000 Subject: [PATCH] Modify usage of blowfish encryption to match new design in which header manipulation handles the init-vector. --- v7/src/edwin/dosfile.scm | 12 +++++++----- v7/src/edwin/filcom.scm | 12 +++++++----- v7/src/edwin/unix.scm | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/v7/src/edwin/dosfile.scm b/v7/src/edwin/dosfile.scm index c51da04fc..3ff3a01a3 100644 --- a/v7/src/edwin/dosfile.scm +++ b/v7/src/edwin/dosfile.scm @@ -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) diff --git a/v7/src/edwin/filcom.scm b/v7/src/edwin/filcom.scm index c8943a6f4..3197d6411 100644 --- a/v7/src/edwin/filcom.scm +++ b/v7/src/edwin/filcom.scm @@ -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))))))))) ;;;; Prompting diff --git a/v7/src/edwin/unix.scm b/v7/src/edwin/unix.scm index c810cb496..5f7d49934 100644 --- a/v7/src/edwin/unix.scm +++ b/v7/src/edwin/unix.scm @@ -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) -- 2.25.1