qrisp.shor.rsa_decrypt_string#

rsa_decrypt_string(e, N, ciphertext, backend=None)[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.

backendBackendClient, 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 = '01010000000101001010001100100110010010000101000010001101000010100011010101110011101000100100011100000100000100110111101000011000111110111111'
>>> from qrisp.shor import rsa_decrypt_string
>>> rsa_decrypt_string(e = 7, N = 65, ciphertext = ciphertext)
'Qrisp is awesome!'