<<

Contents

Search

>>

 

ENCRYPT$

 

 

Function

 

 

Syntax:

ENCRYPT$(<Algorithm>,<Key>,<Text>)

 

<Algorithm>

= <STRING-EXPRESSION>

<Key>

= <STRING-EXPRESSION>

<Text>

= <STRING-EXPRESSION>

 

 

Meaning:

ENCRYPT$ returns the encoded text of <Text> by key <Key> and the algorithm <Algorithm>.

 

By default, the following algorithms are supported by Java

Length of <Key> in Bytes

AES

16

Blowfish

any

DES

8

DESede

24

 

<Key> is used as argument for encoding the <Text>.

 

When encoded data are saved in random files the variable EBUS_FILEMODE must be set to 0. Otherwise the code can be destroyed.

 

Encoded data cannot be saved in sequential files since the code may also contain the characters for linefeed and carriage return.

 

If encoded data are saved in Index Files, the data conversion must be disabled (function SET_FIELDMODE) for the respective Index File fields.

 

In the case of an error (invalid algorithm, invalid <Key> length) ENCRYPT$ returns the empty string "" as result and ERRORTEXT$ contains the respective error message.

 

Parameter:

Algorithm

Encoding algorithm

Key

Key for encoding

Text

Text

 

Sample:

/* Encode with DES algorithm and key "EBUSOFT"

H$ = ENCRYPT$("DES", "EBUSOFT" , "Hello World")

 

See also:

DECRYPT$

EBUS_FILEMODE

SET_FIELDMODE