6. Commandline interface

A lot of the Python-RSA functionality is also available as commandline scripts. On Linux and other unix-like systems they are executable Python scripts, on Windows they are .exe files.

All scripts accept a --help parameter that give you instructions on how to use them. Here is a short overview:

Command

Usage

Core function

pyrsa-keygen

Generates a new RSA keypair in PEM or DER format

rsa.newkeys()

pyrsa-encrypt

Encrypts a file. The file must be shorter than the key length in order to be encrypted.

rsa.encrypt()

pyrsa-decrypt

Decrypts a file.

rsa.decrypt()

pyrsa-sign

Signs a file, outputs the signature.

rsa.sign()

pyrsa-verify

Verifies a signature. The result is written to the console as well as returned in the exit status code.

rsa.verify()

pyrsa-priv2pub

Reads a private key and outputs the corresponding public key.

-

pyrsa-encrypt-bigfile

Encrypts a file to an encrypted VARBLOCK file. The file can be larger than the key length, but the output file is only compatible with Python-RSA.

Deprecated in Python-RSA 3.4 and removed from version 4.0.

pyrsa-decrypt-bigfile

Decrypts an encrypted VARBLOCK file.

Deprecated in Python-RSA 3.4 and removed from version 4.0.