Skip to content
Related Articles

Related Articles

How to Install Python RSA Package on Linux?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 31 Jan, 2022

Python-RSA is an RSA implementation written entirely in Python. According to PKCS#1 version 1.5, it provides encryption and decryption, signing and checking signatures, and key creation. It can be used both on the command line and as a Python library.

Installing Python RSA on Linux:

Method 1: Using pip to install Python RSA Package

Follow the below steps to install the Python RSA package on Linux using pip:

Step 1: Install the latest Python3 in Linux

Step 2: Check if pip3 and python3 are correctly installed.

python3 --version
pip3 --version

checking python and pip version in Linux

Step 3: Upgrade your pip to avoid errors during installation.

pip3 install --upgrade pip

upgrading pip in Linux

Step 4: Enter the following command to install Python RSA using pip3.

pip3 install rsa

installing Python RSA package on Linux using pip

Method 2: Using setup.py to install Python RSA

Follow the below steps to install the Python RSA package on Linux using the setup.py file:

Step 1: Download the latest source package of Python RSA for python3 from here.

curl https://files.pythonhosted.org/packages/8c/ee/4022542e0fed77dd6ddade38e1e4dea3299f873b7fd4e6d78319953b0f83/rsa-4.8.tar.gz > rsa.tar.gz

downloading the source package for Python RSA in Linux

Step 2: Extract the downloaded package using the following command.

tar -xzvf rsa.tar.gz

extracting the rsa.tar.gz file in Linux

Step 3: Go inside the folder and Enter the following command to install the package.

Note: You must have developer tools for XCode Linux installed in your system

cd rsa-4.8
python3 setup.py install

installing Python RSA on Linux using the setup.py file

Verifying Python RSA installation on Linux:

Make the following import in your python terminal to verify if the installation has been done properly:

import rsa

Verifying Python RSA installation on Linux

If there is any error while importing the module then is not installed properly.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!