RSA algorithm and Ceaser cipher both are different.
RSA algorithm follows Asymmetric encryption where as Ceaser Cipher follows Symmetric encryption.
Symmetric encryption is a type of encryption where only one key (a secret key) is used to both encrypt & decrypt the data(electronic information).
Asymmetric encryption uses two keys(public key and private key) to encrypt a plain text. A public key(first key) is made freely available to anyone who might want to send you a message. The second private key is kept a secret so that you can only know.
program for RSA in c++:-
#include<iostream>
#include<math.h>
using namespace std;
int GCD(int a, int b) {
int t;
while(1) {
t= a%b;
if(t==0)
return b;
a = b;
b= t;
}
}
int main() {
//take 2 random prime numbers
double p = 13;
double q = 11;
double n=p*q;//calculate product of given 2 prime numbers.
double track;
double phi= (p-1)*(q-1);//calculate phi
double enc=7;//e is used for encrypt
//for checking that 1 < e < phi(n) and gcd(e, phi(n)) = 1;
i.e., e and phi(n) are coprime.
while(enc<phi) {
track = GCD(enc,phi);
if(track==1)
break;
else
enc++;
}
//choosing d such that it satisfies d*e = 1 mod phi
double d1=1/enc;
double dec=fmod(d1,phi);//d is used for decrypt
double message = 9;
double c = pow(message,enc); //encrypt the message
double m = pow(c,dec);
c=fmod(c,n);
m=fmod(m,n);
cout<<"Original Message = "<<message;
cout<<"\n"<<"p = "<<p;
cout<<"\n"<<"q = "<<q;
cout<<"\n"<<"n = pq = "<<n;
cout<<"\n"<<"phi = "<<phi;
cout<<"\n"<<"e = "<<enc;
cout<<"\n"<<"d = "<<dec;
cout<<"\n"<<"Encrypted message = "<<c;
cout<<"\n"<<"Decrypted message = "<<m;
return 0;
}



program for RSA in C:-
#include<stdio.h>
#include<math.h>
int GCD(int a, int b) {
int t;
while(1) {
t= a%b;
if(t==0)
return b;
a = b;
b= t;
}
}
int main() {
//take 2 random prime numbers
double p = 13;
double q = 11;
double n=p*q;//calculate product of given 2 prime numbers.
double track;
double phi= (p-1)*(q-1);//calculate phi
double enc=7;//e is used for encrypt
//for checking that 1 < e < phi(n) and gcd(e, phi(n)) = 1;
i.e., e and phi(n) are coprime.
while(enc<phi) {
track = GCD(enc,phi);
if(track==1)
break;
else
enc++;
}
//choosing d such that it satisfies d*e = 1 mod phi
double d1=1/enc;
double dec=fmod(d1,phi);//d is used for decrypt
double message = 9;
double c = pow(message,enc); //encrypt the message
double m = pow(c,dec);
c=fmod(c,n);
m=fmod(m,n);
//all double values are adjusted to 3 decimal points.
printf("Original Message = %.3lf",message);
printf("\n p=%.3lf ",p);
printf("\n q=%.3lf ",q);
printf("\n n=%.3lf ",n);
printf("\n phi=%.3lf ",phi);
printf("\n enc=%.3lf ",enc);
printf("\n dec=%.3lf ",dec);
printf("\n encrypted messag=%.3lf ",c);
printf("\n decrypted message=%.3lf ",m);
return 0;
}



Is RSA algorithm is same as Ceaser Cipher Algorithm? if not kindly make simple program of...
In public key cryptosystems, the RSA is the most commonly used algorithm. Answer the following questions: - 1. In the RSA algorithm, what is the security flaw with choosing e = 1 for the public key? (Hint: the RSA formula for encryption is c = M e mod n). 2.You are given a cipher text C=10 by a user whose public key is e=5, n=35. Break the code.
Create a C program: A caesar cipher is a simple cipher that shifts letters in a string. For example, shifting “ab” over by 1 would result in “bc”, and shifting “xyz” over by 2 would result in “zab”. The caesar program should take, in the command line an integer k, the amount to shift some text by, and a string f i l e, the name of a file containing text to encode using the cipher. For example, suppose “secret.txt”...
Use the RSA cipher with public key n = 713 = 23 · 31 and e = 43. (a) Encode 3 and 15 to find their cipher text. (b) Find the least positive inverse for 43 modulo 660 which is the decryption key d. (c) Decode the plaintext for 28, 18 and 129.
The given plaintext is “Feistel cipher structure uses the same algorithm for both encryption and decryption”. Write Java code to implement Shift cipher (Encryption and Decryption) and test your code on given plaintext. Your code must meet following conditions. 1. User must enter the value of key from command prompt and print it at command prompt. 2. Print the cipher text and the plaintext at the command prompt after encryption and decryption. 3. Test your algorithm for 5 different key...
The given plaintext is “Feistel cipher structure uses the same algorithm for both encryption and decryption”. Write Java or Python code to implement Shift cipher(Encryption and Decryption) and test your code on given plaintext. Your code must meet following conditions. (5 points) User must enter the value of key from command prompt and print it at command prompt. (2.5 points) Print the cipher text and the plaintext at the command prompt after encryption and decryption. (2.5 points) Test your algorithm...
Computer Science Encryption Please make it simple thank you. To make a secure block cipher, why is diffusion not enough? That is, why is confusion also necessary?
Discrete Mathematics - RSA Algorithm and Mod These are problems concerning the RSA algorithm and Modulo. A. In RSA, suppose bob chooses p = 3 and q = 43. Determine one correct value of the public exponent e, your choice should be the smallest positive integer that is greater than 1. Justify your answer. B. For the e's value you chose above, compute the corresponding secret exponent d. Show your work. C. Compute 540Mod13 D. Compute 5-1Mod11
An RSA cipher has public key pq = 65 and e = 7. Translate the message YES into its numeric equivalent, and use the formula C = Me (mod pq) to encrypt the message. Decrypt the ciphertext 50 16 and translate the result into letters of the alphabet to discover the message.
CIPHER THAT LETS LOOK PA RSA AT USES Two PRIMES p=23 AND q=17 PUBLIC KEY e=3 A) PRIVATE DECRYPTING KEY d. FIND IN B) DESCRIBE STEPS HOW TO FIND IS c=165. PLAIN TEXT CIPHERTEXTI IF
Using the website Repl.it Write a Java program that can perform the Caesar cipher for English messages that include both upper and lowercase alphabetic characters. The Caesar cipher replaces each plaintext letter with a different one, by a fixed number of places down the alphabet. The program should be able to shift a specific number of places based on the user's input number. For example Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. Ciphertext: QEBNRFZH YOLTK CLU GRJMP...