Encryption/Decryption between Python and Node JS I have created a Python &amp; Node JS encryption/decryption AES 256-CFB. The point of this little project is that I will encrypt a special URL with Python covered with base64 &amp; URL encoding and then the Node JS will decrypt it.
For now the Node JS is working perfectly fine that can starts by decoding the URL, decoding the Base64 and then decrypt the AES with special password key. Meaning that I will have the same key for Node JS and Python to be able to decrypt. Something to add, this will not be added to any other clients/users meaning that covering the password is not needed since no one will reach the code ever but me :)
import base64
import hashlib
import urllib.parse

from Crypto import Random
from Crypto.Cipher import AES

key = &quot;testing&quot;  # Will of course be another password


def encrypt(url):
    &quot;&quot;&quot;
    Encrypting the given url
    :param url:
    :return:
    &quot;&quot;&quot;
    private_key = hashlib.sha256(key.encode()).digest()
    rem = len(url) % 16
    padded = str.encode(url) + (b'\0' * (16 - rem)) if rem &gt; 0 else str.encode(url)
    iv = Random.new().read(AES.block_size)
    cipher = AES.new(private_key, AES.MODE_CFB, iv, segment_size=128)
    enc = cipher.encrypt(padded)[:len(url)]
    return base64.b64encode(iv + enc).decode()


def main():
    encrypted = urllib.parse.quote(encrypt(&quot;https://stackoverflow.com/&quot;))
    url_decode = urllib.parse.unquote(encrypted)

    print(f'Encrypted and URL encoded: {encrypted}\n')
    print(f'URL decoded: {urllib.parse.unquote(url_decode)}\n')


if __name__ == '__main__':
    main()

Now I wonder if there is anyhow where I can improve the code in any how? In my eyes I don't see any ways to improve anyhow but I always end up be wrong :D
The padding step is unnecessary - CFB works out of the box on any plaintext length since it XORS the plaintext with the AES output.
Lack of authentication means that the scheme is vulnerable to a bit flipping attack, where you can flip bits in the ciphertext and cause a corresponding bit flip in the plaintext.
Other nitpicks:

str.encode(url) should be url.encode()
your docstring has a :return: but it doesn't declare anything