<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/shared-module/aesio/__init__.c, branch 6.1.0-beta.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0-beta.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0-beta.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-05-06T09:40:06+00:00</updated>
<entry>
<title>aesio: add basic AES encryption and decryption</title>
<updated>2020-05-06T09:40:06+00:00</updated>
<author>
<name>Sean Cross</name>
<email>sean@xobs.io</email>
</author>
<published>2020-04-14T03:18:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b168784fa0fd97b17807836b390c79abaadfa8e4'/>
<id>urn:sha1:b168784fa0fd97b17807836b390c79abaadfa8e4</id>
<content type='text'>
This adds initial support for an AES module named aesio.  This
implementation supports only a subset of AES modes, namely
ECB, CBC, and CTR modes.

Example usage:

```
&gt;&gt;&gt; import aesio
&gt;&gt;&gt;
&gt;&gt;&gt; key = b'Sixteen byte key'
&gt;&gt;&gt; cipher = aesio.AES(key, aesio.MODE_ECB)
&gt;&gt;&gt; output = bytearray(16)
&gt;&gt;&gt; cipher.encrypt_into(b'Circuit Python!!', output)
&gt;&gt;&gt; output
bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95&gt;\xa7kV\xa2`\x8b\n')
&gt;&gt;&gt;
```

This key is 16-bytes, so it uses AES128.  If your key is 24- or 32-
bytes long, it will switch to AES192 or AES256 respectively.

This has been tested with many of the official NIST test vectors,
such as those used in `pycryptodome` at
https://github.com/Legrandin/pycryptodome/tree/39626a5b01ce5c1cf51d022be166ad0aea722177/lib/Crypto/SelfTest/Cipher/test_vectors/AES

CTR has not been tested as NIST does not provide test vectors for it.

Signed-off-by: Sean Cross &lt;sean@xobs.io&gt;
</content>
</entry>
</feed>
