PicoMite V6.00.01 release candidates - please test thoroughly


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11175
Posted: 11:04am 21 Dec 2024      

Please test the attached. RP2040 base version


PicoMite.zip

MATH AES128
All coding can now accept arrays of any length (subject to memory). Strings for encrypting are limited to 240bytes (EBR) and 224bytes (CTR and CBC)

For CTR and CBC encryption an output array, if used, must now be 16 elements BIGGER than the input. You can optionally specify an initialisation vector, otherwise a random vector is created.

For CTR and CBC decryption an output array, if used, must now be 16 elements SMALLER than the input (which now includes the IV). Therefore you no longer specify the initialisation vector for decoding as this is now included in the message as the first block

New functionality

MATH(BASE64 ENCRYPT/DECRYPT in$/in(), out$/out())
This base64 encrypts or decrypts the data in 'in' and puts the result in 'out'. This is a function that returns the length of the 'out' data. Where arrays are used as the output they must be big enough relative to the input and the direction so encryption increases length by 4/3 and decryption decrease it by 3/4

e.g.
Dim a$="1234567890",b$,c$
? math(base64 encrypt a$,b$)
? b$
? math(base64 decrypt b$,c$)
? c$