ciphertext question
Posted: Sun Aug 14, 2022 3:23 am
The crypto lib in pycom's flavour of micropython allows creating a cipher for less than 16 bytes
The ucrytolib in regular micropython however seems to only work with 16 bytes, so that shorter messages have to be padded to 16 bytes
Just wondering if there is anyone on the forum familiar with both libs who knows why crypto can handle the shorter messages without prompting the error?
Code: Select all
import crypto
from crypto import AES
msg='shortxt'
iv=b'sixteen chatr iv'
cipher=AES(key, AES.MODE_CFB, iv)
Code: Select all
import cryptolib
msg='shortxt'+'89abcdef0'
iv=b'sixteen chatr iv'
cipher=cryptolib.aes(key, 2, iv)
Code: Select all
ValueError: blksize % 16