U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » UppHub » [REPLACED by Cypher package]StreamCypher - A package for stream data cryptography
Re: [REPLACED by Cypher package]StreamCypher - A package for stream data cryptography [message #58346 is a reply to message #58333] Wed, 04 May 2022 12:42 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
They're simmetric encoders/decoders.
If you apply 2 times you get original text.

// key must be 16 or 32 bit... here a sample 16 bit key
key = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10";

// create encoder
Snow2 snow(key):

// encode text
String s "Some text to encode";
String encoded = snow(s);

// reset encoder/decoder
snow.SetKey(key);

// decode text
String decoded = snow(encoded);


Ciao

Massimo
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Error with MessageCtrl when using "["
Next Topic: Uniq : single instance applications made easy
Goto Forum:
  


Current Time: Fri Jun 19 06:16:38 GMT+2 2026

Total time taken to generate the page: 0.00801 seconds