hutorny / chaskey Goto Github PK
View Code? Open in Web Editor NEWA lightweight 128-bit encryption algorithm implemented in C++ and JavaScript
License: MIT License
A lightweight 128-bit encryption algorithm implemented in C++ and JavaScript
License: MIT License
var mac = new ChaskeyCipher.Mac(); // instantiate a cipher in MAC mode
mac.set([1,2,3,4]); // set the key
console.log(mac.sign(new Uint8Array(0)));
console.log(mac.sign(new Uint8Array(0)));
console.log(mac.sign(new Uint8Array(17)));
console.log(mac.sign(new Uint8Array(0)));
prints the following:
Uint8Array(16) [164, 51, 219, 196, 236, 190, 42, 255, 44, 145, 84, 85, 202, 211, 40, 178]
Uint8Array(16) [164, 51, 219, 196, 236, 190, 42, 255, 44, 145, 84, 85, 202, 211, 40, 178]
Uint8Array(16) [206, 55, 154, 136, 95, 96, 215, 4, 30, 37, 59, 16, 223, 175, 215, 176]
Uint8Array(16) [89, 208, 133, 178, 254, 56, 60, 179, 61, 217, 110, 222, 43, 11, 187, 61]
I expect the last line to be
Uint8Array(16) [164, 51, 219, 196, 236, 190, 42, 255, 44, 145, 84, 85, 202, 211, 40, 178]
The reason is that the formatter object's byte buffer is not reset completely upon reset. It is filled with zeros instead of truncated to zero length.
While Chaskey is it self constructed as CMAC/OMAC with EvanMansour block cipher, afaik it was never claimed its building block (EM block cipher) is safe to be used as standalone building block for encryption. More over, cryptoanalyzes have sentences about "attaker has no way for chosen ciphertext attack".
May be I'm missing something? Can you point on investigations?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.