Link | lp_crypt_xor |
Author | Bil Corry |
Category | Encryption |
Version | 8.x |
License | Public Domain |
Posted | 21 Apr 2006 |
Updated | 21 Apr 2006 |
More by this author... |
Returns xor-encrypted/decrypted string given a string and password.
Requires [lp_array_roundrobin] [lp_string_asc] [lp_string_chr]
var:'text' = 'This is my message I want to encrypt.'; var:'password' = 'secret'; var:'encrypted_text' = (lp_crypt_xor: $text,$password); var:'decrypted_text' = (lp_crypt_xor: $encrypted_text,$password); ''; 'Encrypted = ' $encrypted_text '\r\n'; 'Decrypted = ' $decrypted_text '\r\n'; '';
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
[ define_tag: 'lp_crypt_xor', -description='Returns xor-encrypted/decrypted string given a string and password.', -priority='replace', -required='string', -required='password'; // init output local:'out' = string; // convert password for xor'ing local:'password_rr' = lp_array_roundrobin; iterate: (string: #password), local:'char'; #password_rr->(insert: (lp_string_asc:#char)); /iterate; // xor password against string local:'loop' = integer; local:'xor' = integer; iterate: (string: #string), local:'char'; #xor = lp_string_asc:#char; #xor->(bitxor: #password_rr); #out += (lp_string_chr:#xor); /iterate; // return bytes return: #out; /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft