This is simple example of using NodeMCU ESP8266 for AES encryption. There is also example of decoding data in Node.js (https://github.com/dmaixner/nodejs-esp8266-aes-decrypt).
Using https://github.com/spaniakos/AES/ library for AES and https://github.com/fcgdam/ESP8266-base64 library for Base64 coding/decoding. There are small modifications to both of those libs to make them work with NodeMCU ESP8266, you can find them here:
Code is built with Platform IO.