[Python-checkins] CVS: python/nondist/peps pep-0272.txt,1.1,1.2

A.M. Kuchling akuchling@users.sourceforge.net
Thu, 20 Sep 2001 09:12:28 -0700


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv27026

Modified Files:
	pep-0272.txt 
Log Message:
'blocksize' -> 'block_size', 'keysize' -> 'key_size'
Rip out the key_size attribute of cipher objects
Set PEP number
Various rewrites


Index: pep-0272.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0272.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pep-0272.txt	2001/09/20 16:06:16	1.1
--- pep-0272.txt	2001/09/20 16:12:26	1.2
***************
*** 1,3 ****
! PEP: XXX
  Title: API for Secret-Key Encryption Algorithms
  Version: $Revision$
--- 1,3 ----
! PEP: 272
  Title: API for Secret-Key Encryption Algorithms
  Version: $Revision$
***************
*** 11,15 ****
  
      This document specifies a standard API for secret-key encryption
!     algorithms, such as DES or Rijndael, making it easier to switch
      between different algorithms and implementations.  The API is
      intended to be suitable for both block and stream ciphers.
--- 11,15 ----
  
      This document specifies a standard API for secret-key encryption
!     algorithms such as DES or Rijndael, making it easier to switch
      between different algorithms and implementations.  The API is
      intended to be suitable for both block and stream ciphers.
***************
*** 21,31 ****
      plaintext) in some way that is dependent on a variable key,
      producing ciphertext.  The transformation can easily be reversed,
!     if and only if one knows the key (we hope).  The key is a sequence
!     of bits chosen from some very large space of possible keys.
  
!     Block ciphers take multibyte inputs of a fixed size (frequently 8
!     or 16 bytes long) and encrypt them.  Block ciphers can be operated
!     in various feedback modes.  The feedback modes supported in this
!     specification are: 
  
          Number    Constant      Description
--- 21,30 ----
      plaintext) in some way that is dependent on a variable key,
      producing ciphertext.  The transformation can easily be reversed,
!     if and only if one knows the key.  The key is a sequence of bits
!     chosen from some very large space of possible keys.
  
!     Block ciphers encrypt multibyte inputs of a fixed size (frequently
!     8 or 16 bytes long), and can be operated in various feedback
!     modes.  The feedback modes supported in this specification are:
  
          Number    Constant      Description
***************
*** 33,38 ****
          2         CBC           Cipher Block Chaining
          3         CFB           Cipher FeedBack 
!         4         PGP           Variant of CFB used by the OpenPGP standard
  
      In a strict formal sense, stream ciphers encrypt data bit-by-bit;
      practically, stream ciphers work on a character-by-character
--- 32,41 ----
          2         CBC           Cipher Block Chaining
          3         CFB           Cipher FeedBack 
!         4         PGP           Variant of CFB
  
+     See _Applied Cryptography_ for descriptions of the first three
+     feedback modes.  The PGP feedback mode is described in the OpenPGP
+     RFC.
+ 
      In a strict formal sense, stream ciphers encrypt data bit-by-bit;
      practically, stream ciphers work on a character-by-character
***************
*** 45,51 ****
  Specification
  
!     All cipher algorithms share a common interface.  After importing a
!     given module, there is exactly one function and two variables
!     available.
  
      Secret-key encryption modules define one function:
--- 48,52 ----
  Specification
  
!     All cipher algorithms share a common interface.  
  
      Secret-key encryption modules define one function:
***************
*** 69,89 ****
      Secret-key encryption modules define two variables:
  
!     blocksize
  
          An integer value; the size of the blocks encrypted by this
          module.  For all feedback modes, the length of strings passed to
          the encrypt() and decrypt() must be a multiple of the block size.
!         For stream ciphers, \code{blocksize} will be 1.
  
!     keysize
  
          An integer value; the size of the keys required by this
!         module.  If keysize is zero, then the algorithm accepts
          arbitrary-length keys.  You cannot pass a key of length 0
          (that is, the null string '') as such a variable-length key.
  
!     All cipher objects have at least three attributes:
  
!     blocksize
  
          An integer value equal to the size of the blocks encrypted by
--- 70,90 ----
      Secret-key encryption modules define two variables:
  
!     block_size
  
          An integer value; the size of the blocks encrypted by this
          module.  For all feedback modes, the length of strings passed to
          the encrypt() and decrypt() must be a multiple of the block size.
!         For stream ciphers, \code{block_size} will be 1.
  
!     key_size
  
          An integer value; the size of the keys required by this
!         module.  If key_size is zero, then the algorithm accepts
          arbitrary-length keys.  You cannot pass a key of length 0
          (that is, the null string '') as such a variable-length key.
  
!     Cipher objects require two attributes:
  
!     block_size
  
          An integer value equal to the size of the blocks encrypted by
***************
*** 99,113 ****
          It is read-only, and cannot be assigned a new value.
  
!     keysize (XXX this is in mxCrypto, but do we actually need this?  
!         I can't remember why it was there, and it seems stupid.)
! 
!         An integer value equal to the size of the keys used by this
!         object.  If keysize is zero, then the algorithm accepts
!         arbitrary-length keys.  For algorithms that support variable
!         length keys, this will be 0.  Identical to the module variable
!         of the same name.  It does *not* contain the size of the key
!         actually
! 
!     The methods for secret-key encryption objects are as follows:
  
      decrypt(string)
--- 100,104 ----
          It is read-only, and cannot be assigned a new value.
  
!     Cipher objects require the following methods:
  
      decrypt(string)
***************
*** 120,124 ****
      encrypt(string)
  
!         Encrypts a non-null string, using the key-dependent data in
          the object, and with the appropriate feedback mode.  The
          string's length must be an exact multiple of the algorithm's
--- 111,115 ----
      encrypt(string)
  
!         Encrypts a non-empty string, using the key-dependent data in
          the object, and with the appropriate feedback mode.  The
          string's length must be an exact multiple of the algorithm's