Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8889635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:18:32+00:00 2026-06-14T22:18:32+00:00

#include <string.h> #include <conio.h> #include <math.h> int mult(unsigned int x, unsigned int y, unsigned

  • 0
#include <string.h>
#include <conio.h>
#include <math.h>

int mult(unsigned int x, unsigned int y, unsigned int n) {
    unsigned long int k = 1;
    int j;
    for (j = 1; j <= y; j++)
        k = (k * x) % n;
    return (unsigned int) k;
}

void main() {
    char msg[100];
    unsigned int pt[100], ct[100], n, d, e, p, q, i;
    printf("Enter message : ");
    gets(msg);
    //strcpy(pt, msg);
    for (i = 0; i < strlen(msg); i++)
        pt[i] = msg[i];
    n = 253;
    d = 17;
    e = 13;
    printf("\nCT = ");
    for (i = 0; i < strlen(msg); i++)
        ct[i] = mult(pt[i], e, n);
    for (i = 0; i < strlen(msg); i++)
        printf("%d ", ct[i]);
    printf("\nPT = ");
    for (i = 0; i < strlen(msg); i++)
        printf("%c", pt[i]);
    for (i = 0; i < strlen(msg); i++)
        pt[i] = mult(ct[i], d, n);
}

This is simple program for implementing RSA algorithm can anybody explain me what’s happening here and why particularly n=253, d=17 , e=13.

Help would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:18:34+00:00Added an answer on June 14, 2026 at 10:18 pm

    http://en.wikipedia.org/wiki/RSA_(algorithm).

    253=11*23, // n=253 is product of two “large” primes p,q

    phi(n)=10*22=220. // Eulers totient function is calculated from p,q
    e= 13 // a small number, that is coprime with phi(n).
    Then d is calculated so, that e*d=1 mod 220 –> d=17
    -> d*e=221 === 1 mod 220.

    Throw p,q away.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include <string.h> #include <stdlib.h> #include <stdio.h> int main(void) { unsigned char *stole; unsigned char
#include<iostream.h> #include<conio.h> class String { char str[100]; public: void input() { cout<<Enter string :;
See the following program: #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> main(void){ printf(Array
So basically: #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> int main(void){ //test strrev
#include<iostream.h> #include<conio.h> #include<string.h> class flight { private : int flightno; char source[30],destination[30]; protected :
I am thinking of something like: #include <stdio.h> #include <conio.h> #include <stdlib.h> int main(void)
To make a string a null string i wrote this: #include<stdio.h> #include<conio.h> #include<string.h> int
#include <stdio.h> #include <string.h> #include <conio.h> #include <iostream> using namespace std; char a[21]; //
Hey guys. Check out this piece of sample code. #include stdafx.h #include<conio.h> #include<string.h> class
I have a code: #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> typedef struct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.