title: Encryption: Replacing simple-crypt inline?
body: <p>Simple-crypt is an outdated packed based on the deprecated-a-long-time-ago and very unsecure package pycrypto, and TIL that we are using it in our large company project. pycryptodome is listed as a drop-in replacement, however, for this library, uninstalling pycrypto and installing pycryptodome fails immediately with an importerror.</p>
  <p>Encrypted data is already stored in our database. I'd like to be able to avoid decrypting it and recrypting it.</p>
  <p>Since simple-crypt uses AES, can I just use any old AES256 encryption with the same key to get the same encoding/decoding?</p>
  <p>What's the best way to replace code such as this if so?</p>
  <pre><code>        if id:
              validated_data[&quot;id&quot;] = hexlify(
                  encrypt(THE_KEY, id.encode(&quot;utf8&quot;))
              ).decode(&quot;utf-8&quot;)
  </code></pre>