Remove references to stream ciphers. As a result, this is now retitled the

block encryption API PEP.
This commit is contained in:
Andrew M. Kuchling 2002-04-16 21:24:19 +00:00
parent c33c266f9f
commit 7e43fdeaa1
1 changed files with 13 additions and 15 deletions

View File

@ -1,5 +1,5 @@
PEP: 272
Title: API for Secret-Key Encryption Algorithms
Title: API for Block Encryption Algorithms
Version: $Revision$
Author: A.M. Kuchling <akuchlin@mems-exchange.org>
Status: Draft
@ -9,10 +9,9 @@ Post-History:
Abstract
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.
This document specifies a standard API for secret-key block
encryption algorithms such as DES or Rijndael, making it easier to
switch between different algorithms and implementations.
Introduction
@ -31,7 +30,7 @@ Introduction
Number Constant Description
1 MODE_ECB Electronic Code Book
2 MODE_CBC Cipher Block Chaining
3 MODE_CFB Cipher FeedBack
3 MODE_CFB Cipher Feedback
5 MODE_OFB Output Feedback
6 MODE_CTR Counter
@ -48,10 +47,11 @@ Introduction
In a strict formal sense, stream ciphers encrypt data bit-by-bit;
practically, stream ciphers work on a character-by-character
basis. Stream ciphers can support the API described here by using
fixing the block length at 1; this is how block and stream ciphers
could be distinguished. The only feedback mode available for
stream ciphers is ECB mode.
basis. This PEP only aims at specifying an interface for block
ciphers, though stream ciphers can support the interface described
here by fixing 'block_size' to 1. Feedback modes also don't make
sense for stream ciphers, so the only reasonable feedback mode
would be ECB mode.
Specification
@ -124,8 +124,7 @@ Specification
An integer value; the size of the blocks encrypted by this
module, measured in bytes. 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, block_size
will be 1.
multiple of the block size.
key_size
@ -166,9 +165,8 @@ Specification
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
block size or, in CFB mode, of the segment size. For stream
ciphers, the string can be of any length. Returns a string
containing the ciphertext.
block size or, in CFB mode, of the segment size. Returns a
string containing the ciphertext.
Here's an example, using a module named 'DES':