Here at Crypto.SE, acquainted members would suggest you to look at AEAD - Authenticated Encryption with Associated Data. This is a type of encryption that guarantees the secrecy of your message, in addition to which, a "header" and their integrity. AEAD algorithms also help identify malformed ciphertext messages by including a "Tag" when performing encryption and verifying it at decryption.
Typical AEAD algorithms include AES-GCM, ChaCha20-Poly1305, etc. There should by python modules available for use in django (I went to your SO profile). At client-side JS however, only AES-GCM is usually available.
Now, needing encryption at application level is probably not as good a solution as having encryption at transport level - in this case, you should consider securing your connection with TLS (ver 1.2 or 1.3). This needs a certificate, which is around 1k USD for wildcard domain names, but could be cheaper for single-domain cases.
What you're describing looks more like a password-hashing algorithm, in which case, your nonce should be salt (nonce is only unique, where as salt must be random). There should also be a bcrypt or argon python module you can use.