


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
this is my assignment on how to implement RSA algorithm
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



// C program for RSA asymmetric cryptographic // algorithm. For demonstration values are // relatively small compared to practical // application #include<stdio.h> #include<math.h> // Returns gcd of a and b int gcd( int a, int h) { int temp; while (1) { temp = a%h; if (temp == 0) return h; a = h; h = temp; } } // Code to demonstrate RSA algorithm int main() { // Two random prime numbers double p = 3; double q = 7; // First part of public key: double n = p*q;