Encryption of name and number using aes-256 algorithm

We have a PWA bot where we are asking name and number from the user and passing the user to a third-part website. Now we want to encrypt this name and number using aes-256 algorithm and pass it using a dynamic url key.

Client has already provided us the encryption key.

Do we have any code snippet for this?

pass that variable value to encryption code then it will encrpt the data.

@Sai_Kumar_Singaram can you please elaborate?