swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

blowfish.decode

 
 

Library: Blowfish (OMBLOWFISH)
Import: omblowfish.xmd
Return type: String

Returns: A string encoding of the decrypted data


Declaration

export external string function
      decode (value string s,
              value state  state) elsewhere


Purpose

Use decode to read a string, its first argument, and decrypt it against an encryption state, its second argument. The decrypted data is returned as a string that can be further processed.

The state argument must be initialized with an encryption key; this can be accomplished using set-encryption-key.

The input string must be at most eight characters long. If it is any shorter, it is padded with null bytes to a length of eight characters. If it is any longer, an exception is thrown. The returned string is always eight characters long, and may contain null bytes.

Usage Note

To use decode, you must import OMBLOWFISH.XMD into your program using a statement like this:

     import "omblowfish.xmd" prefixed by blowfish.

(Please see the import topic for more on importing.)

Example


     import "omblowfish.xmd" prefixed by blowfish.
  
  
     define string source function
        f
     as
        local integer i initial { "df" base 16, "33" base 16, "3f" base 16, "d2" base 16,
                                  "30" base 16, "a7" base 16, "1b" base 16, "b4" base 16 }
  
        repeat over i
           output "b" % i
        again
  
  
     process
        local blowfish.state state initial { "TESTKEY" }
        local string         s
  
        set s to blowfish.decode (f, state)

    Related Topics
 
Other Library Functions
 
 

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

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.