I am using this Arduino library and this Android library to:
- Create random string in Arduino
- Pass it to Android to encrypt with AES and shared secret key
- Pass back to Arduino to decrypt with AES and shared secret key
- Verify that original random string matches decrypted string
I'm am using AES 128bit in both devices and CBC and can get them to encrypt and decrypt their own strings, but I'm having trouble tying them together. I've got a few questions that will hopefully help:
- How do the "blocks" in the Arduino code relate to the Android implementation?
- From what I've read, to decrypt the cipher text on the Arduino from Android I will need to send, the cipher text, the IV, and the PBE iteration count. Is that correct and everything?
- Android code takes my key and uses a bunch of SecretKeys functions on it to I think randomize it and make it more secure. If I'm having to store the key on the Arduino, do I need to even bother with this?
Where is the PBE iteration count in the Arduino code? I don't really see anything in the library. Do I need to implement that myself? I saw in the "test_vectors" example of the library a section that had the following bit of code. Is this the iteration?
for (int j = 0 ; j < 1000 ; j++)
{
succ = aes.encrypt (plain, cipher) ;
aes.copy_n_bytes (plain, cipher, 16) ;
}
Aucun commentaire:
Enregistrer un commentaire