title: Error while trying to decrypt a RSA encrypted text
body: <p>I am a newbie when it comes to Python, and I have only recently begun to learn the language.
  I was intrigued by the idea of encryption, so I began to experiment with RSA.</p>
  <p>I use the version 4.8 of RSA.</p>
  <p>However, I am unable to decrypt the encrypted message using the private key since I get an error:</p>
  <pre><code>    Traceback (most recent call last):
    File &quot;C:\Users\darko\PycharmProjects\TestingPY\decryption test.py&quot;, line 6, in &lt;module&gt;
      decrypted = rsa.decrypt(encrypted, privatekey).decode()
    File &quot;C:\Users\darko\PycharmProjects\TestingPY\venv\lib\site-packages\rsa\pkcs1.py&quot;, line 254, in decrypt
      blocksize = common.byte_size(priv_key.n)
  AttributeError: 'str' object has no attribute 'n'
  </code></pre>
  <p>Can someone help me?</p>
  <p>The Python script is this:</p>
  <pre><code>import rsa
  
  encrypted = input(&quot;Input encrypted text to decrypt: &quot;)
  privatekey = input(&quot;Input PrivateKey to decrypt: &quot;)
  
  decrypted = rsa.decrypt(encrypted, privatekey).decode()
  print(&quot;Decrypted: &quot; + str(decrypted))
  </code></pre>