Melang

Logo

A script language of preemptive scheduling coroutine in single thread

View the Project on GitHub Water-Melon/Melang

DES

This document includes DES and 3DES functions.

Import

d = Import('des');
des
d.des(data, key, op);

Input:

Return value:

Error:

Example:

d = Import('des');
sys = Import('sys');

text = 'DES test'; //length is 8
cipher = d.des(text, 100, 'encode');
sys.print(cipher);
sys.print(d.des(cipher, 100, 'decode'));

The output is:

4xF???Q
DES test
des3
des3(data, key1, key2, op);

Input:

Return value:

Error:

Example:

d = Import('des');
sys = Import('sys');

text = 'DES test'; //length is 8
cipher = d.des3(text, 100, 99, 'encode');
sys.print(cipher);
sys.print(d.des3(cipher, 100, 99, 'decode'));

The output is:

t?M??*?
DES test