# glance.common.crypt module

Routines for URL-safe encrypting/decrypting

glance.common.crypt.urlsafe_decrypt(key, ciphertext)

  Decrypts URL-safe base64 encoded ciphertext. On Python 3, the result is decoded from UTF-8.

  Parameters:

    - key – AES secret key

    - ciphertext – The encrypted text to decrypt

  Returns:

    Resulting plaintext

glance.common.crypt.urlsafe_encrypt(key, plaintext, blocksize=16)

  Encrypts plaintext. Resulting ciphertext will contain URL-safe characters. If plaintext is Unicode, encode it to UTF-8 before encryption.

  Parameters:

    - key – AES secret key

    - plaintext – Input text to be encrypted

    - blocksize – Non-zero integer multiple of AES blocksize in bytes (16)

  Returns:

    Resulting ciphertext

this page last updated: 2026-03-19 01:38:33

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug