swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     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 Syntax
   blowfish.encode
   blowfish.set-encryption-key
 
  Other Library Functions
   blowfish.decode
   blowfish.encode
   blowfish.set-encryption-key
   blowfish.state
 
 

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.