A script language of step-sharing scheduling coroutine in single thread
This document includes DES and 3DES functions.
d = Import('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(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