qrisp.shor.rsa_decrypt_string#

rsa_decrypt_string(e: int, N: int, ciphertext: str, backend: BackendLike | None = None) → str[source]#

Decrypts a bitstring into a human readable string.

Parameters:
eint

Public key 1.

Nint

Public key 2.

ciphertextstring

A bitstring, containing the encrypted message.

backendBackendLike, optional

The backend to execute the quantum algorithm. By default the Qrisp simulator will be used.

Returns:
plaintextstring

The decrypted string.

Examples

We decrypt the message we encrypted in the example of rsa_encrypt_string.

>>> ciphertext = (
...     '0101000000010100101000110010011001001000010100001000110100001010001101'
...     '0101110011101000100100011100000100000100110111101000011000111110111111'
... )
>>> from qrisp.shor import rsa_decrypt_string
>>> rsa_decrypt_string(e = 7, N = 65, ciphertext = ciphertext)
'Qrisp is awesome!'