Since things didn't work out between me and mbedtls, here are the basic encryption algorithms.