swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

blowfish.reader-encrypt

 
 

Library: Blowfish (OMFFBLOWFISH)
Import: omffblowfish.xmd
Return type: string source

Returns: A scannable input source for streaming data


Declaration

export string source function
      reader-encrypt     from value string source input-data
                     with-key value string encryption-key elsewhere


Purpose

Use reader-encrypt to read a string source, its first argument, and encrypt it using an encryption key, its second argument. The encrypted data is returned as a string source that can be further processed. Note that the Blowfish algorithm processes data in 64-bit chunks. If the length of input-data is not a multiple of 64 bits, it will be padded with null bytes. Similarly, the length of the data generated by reader-encrypt will be a multiple of 64 bits.

Usage Note

To use reader-encrypt, you must import OMFFBLOWFISH.XMD into your program using a statement like this:

     import "omffblowfish.xmd" prefixed by blowfish.
(Please see the import topic for more on importing.)

Example


     import "omffblowfish.xmd" prefixed by blowfish.
  
     process
        local string encryption-key initial { "ENCRYPTION KEY" }
  
        set file "cypher.txt" to blowfish.reader-encrypt from file "clear.txt" with-key encryption-key

    Related Syntax
   blowfish.reader-decrypt
   blowfish.writer-decrypt
 
  Other Library Functions
   blowfish.reader-decrypt
   blowfish.reader-encrypt
   blowfish.writer-decrypt
   blowfish.writer-encrypt
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.