Dec 11, 2015 What occurs after RSA keys are generated on a Cisco router to prepare for secure device management? All vty ports are automatically configured for SSH to provide secure management. The general-purpose key size must be specified for authentication with the crypto key generate rsa general-keys modulus command. What exactly does 'crypto key generate rsa' do? When setting up SSH you have to create the rsa key, what does it actually do? How does the router use it? Save hide report. This thread is archived. New comments cannot be posted and votes cannot be cast.
In this chapter, we will focus on step wise implementation of RSA algorithm using Python.
The following steps are involved in generating RSA keys −
Create two large prime numbers namely p and q. The product of these numbers will be called n, where n= p*q
Generate a random number which is relatively prime with (p-1) and (q-1). Let the number be called as e.
Calculate the modular inverse of e. The calculated inverse will be called as d.
We need two primary algorithms for generating RSA keys using Python − Cryptomath module and Rabin Miller module.
The source code of cryptomath module which follows all the basic implementation of RSA algorithm is as follows −
The source code of RabinMiller module which follows all the basic implementation of RSA algorithm is as follows −
The complete code for generating RSA keys is as follows −
The public key and private keys are generated and saved in the respective files as shown in the following output.