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