![Serial Serial](/uploads/1/2/5/4/125498127/661130147.png)
Hackaday.io user Abderraouf has written an. While we’re not big enough crypto-nerds to assess the security of the code, it looks like it’s going to be pretty handy. Spritz itself is a neat cipher. Instead of taking in fixed blocks of data and operating on them, it allows you to process it in (almost) whatever chunks it comes in naturally, and then extract out the encrypted results piecewise. It works both as a two-way cipher and as a one-way hash function. It looks like Spritz is a one-stop-shop for all of your encryption needs, and now you can run it on your Arduino.
I want to encrypt a text using Arduino and decrypt it using Java. I tried this code from this link but without success. I am using this Arduino library for encryption on the Arduino and the Java Cryptographic Extension (JCE) framework for the Java side.
In case you are afraid of new implementations of new ciphers (and you should be), Spritz’s pedigree should help to put you at ease: it was developed by to be a successor to his RC4 algorithm, and it incorporates a lot of the lessons learned about that algorithm over the past. This doesn’t exclude subtle flaws in the implementation of the library (no offence, Abderraouf!) or your work downstream, but at least the underlying algorithm seems to be the real deal. Abderraouf links it in his writeup, but just for completeness, here’s the. What crypto libraries do you currently use for Arduino or microcontroller projects? We’ve been fans of for ages, but more because it’s simple and small than because it’s secure.
Spritz may be simple enough to implement easily, and still more secure. Posted in, Tagged, Post navigation. Sacrificing 1/8th of an UNO’s RAM is a perfectly acceptable trade off I think.
![Arduino Serial Encryption Arduino Serial Encryption](/uploads/1/2/5/4/125498127/849826716.jpg)
(1/32nd for a mega) A hint for those running web-servers on the Arduino: using f on a string stores the string in flash without consuming ram. This DRAMATICALLY reduces the memory consumption, as all the HTML is then stored in program memory. As for this thing’s strength, I figure it’s probably strong enough that if someone goes to the trouble of cracking it, the effort involved will mean I have a much bigger problem on my hands (especially consider it’s running on an Arduino UNO, which I don’t tend to use for ultra-sensitive stuff (or really, any sensitive stuff; is my house’s temperature/humidity really that important?)).
1) Why are you using String rather than char arrays? Using String makes you go through a lot of contortions that are not needed. 2) I see no padding applied to the cleartext before encryption. This means your cleartext length must be an exact multiple of the AES block size. 3) Why are you using the cleartext mes.length inside your decrypt method. Surely it should be deduced from the b64data parameter. 4) Why are you not using the base64 encoded length obtained from the base64encode method.
5) Why are you not using the base64 decoded length obtained from the base64decode method. Taken together points 2 through 5 could easily cause your symptoms.