Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Cipher Source Code
 previous   up   next 

Types
cipherAlgorithm
Enumeration of cipher algorithms.
cipherState
Interface type for the internal state of a cipher.
noCipherState
cipherState implementation type describing the state when no cipher is used.

cipherAlgorithm

const type: cipherAlgorithm

Enumeration of cipher algorithms. Currently the ciphers NO_CIPHER, RC4, DES, TDES and AES are supported.


cipherState

const type: cipherState

Interface type for the internal state of a cipher. The cipherState interface is implemented with arc4, des, tdes and noCipher (no encryption).


noCipherState

const type: noCipherState

cipherState implementation type describing the state when no cipher is used. The data remains unencrypted, when NO_CIPHER is used.


Function Summary
integer
blockSize (in cipherAlgorithm: cipherAlg)
Block size used by the given cipherAlgorithm.
cipherState
setCipherKey (in cipherAlgorithm: cipherAlg, in string: cipherKey, in string: initializationVector)
Set key and initialization vector for the given cipherAlgorithm.
string
encode (inout cipherState: state, in string: plaintext)
Encode a string with the state of the selected cipher algorithm.
string
decode (inout cipherState: state, in string: encoded)
Decode a string with the state of the selected cipher algorithm.

Function Detail

blockSize

const func integer: blockSize (in cipherAlgorithm: cipherAlg)

Block size used by the given cipherAlgorithm. Stream ciphers have a block size of 0.

Returns:
the block size used by the cipherAlgorithm.

setCipherKey

const func cipherState: setCipherKey (in cipherAlgorithm: cipherAlg, in string: cipherKey, in string: initializationVector)

Set key and initialization vector for the given cipherAlgorithm.

Parameters:
cipherAlg - The cipherAlgorithm to be used.
Returns:
the cipherState of the cipherAlgorithm.

encode

const func string: encode (inout cipherState: state, in string: plaintext)

Encode a string with the state of the selected cipher algorithm.

Returns:
the encoded string.

decode

const func string: decode (inout cipherState: state, in string: encoded)

Decode a string with the state of the selected cipher algorithm.

Returns:
the decoded string.


 previous   up   next