# Porting node.js encryption function to Elixir

**URL:** <https://forum.elixirforum.com/t/porting-node-js-encryption-function-to-elixir/39493>\
**Category:** Questions\
**Tags:** crypto\
**Created:** [May 7, 2021, 8:52pm UTC](https://forum.elixirforum.com/t/porting-node-js-encryption-function-to-elixir/39493 "2021-05-07T20:52:45Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [May 24, 2021, 9:29am UTC](https://forum.elixirforum.com/t/porting-node-js-encryption-function-to-elixir/39493/12 "2021-05-24T09:29:59Z")

</div>

That is why if you have these thee letters anywhere in your code `AES` then you are probably vulnerable. If you want to do it right you have few options:

- If there is no additional requirements - encrypt only on transport layer, like TLS, and call it a day
- Use good token implementations, like [PASETO](https://paseto.io) ([JOSE (used by JWT) is plagued with problems](https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-bad-standard-that-everyone-should-avoid))
- Use [foolproof API from entrusted authors](https://doc.libsodium.org/secret-key_cryptography/secretbox) instead of building the protocol on your own

Doing crypto on your own is **enormously hard**.

---

_[View the full topic](https://forum.elixirforum.com/t/porting-node-js-encryption-function-to-elixir/39493)._
