Click here to Skip to main content
Licence 
First Posted 5 May 2003
Views 187,201
Bookmarked 35 times

RSA encryption/decryption

By | 5 May 2003 | Article
Find a RSA implementation in VC++. Key size is 32-bit.

Introduction

Note: Please refer rsa.doc for more details on code and software. I can be contacted at bhaskar_bora@yahoo.com for further queries. Implementation includes private and public key (32-bit) generation and support of text file encryption and decryption. This document contains the algorithms and information required to design and implement RSA algorithm in VC++. This software is only for text data encryption and decryption. Document also contains the software usage guidelines and screen-shots.

Intro to RSA

RSA algorithm is mainly a public key encryption technique used widely in network communication like in Virtual Private Networks (VPNs). In public key encryption technique, a key is split into two keys and they are called as public and private keys. Public key is advertised to the world and private key is kept secret. It is not possible to generate private key using the public key. So, someone who knows the public key cannot decrypt a message after it has been encrypted using the public key.

RSA algorithm is a block cipher technique in which plain text and cipher text are integers between ‘0’ and ‘n-1’ from some ‘n’. In RSA algorithm encryption and decryption are of following form, for some plain text M and cipher text C:

C = M^e mod n

M = C^d mod n

Both sender and receiver must know the value of ‘n’. The sender knows the value of ‘e’ and only receiver knows the value of ‘d’. Thus, this is a public-key encryption algorithm with a public key of KU={e, n} and private key of KR={d, n}. For the algorithm to be satisfactory for public-key encryption, the following requirement must be met

  1. It is possible to find values of e, d, n such that M^ed = M mod n for all M<n.
  2. It is relatively easy to calculate M^e and C^d for all values of M<n.
  3. It is infeasible to determine d given e and n.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

BhaskarBora

Web Developer

India India

Member

Working with EMC Corp, Bangalore (India) in distributed embedded software design. Like to read and code in storage, computer security and language design areas.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Questionhelp Pinmembersteven stevanus17:01 23 Feb '12  
Questionhelp Pinmembersteven stevanus17:00 23 Feb '12  
Questionis your software Encrypt/Decrypt the text by 128 bit key PinmemberRaj.Amit21:51 29 Jul '10  
GeneralMy vote of 1 PinmemberKarstenK21:26 6 Jun '10  
Questionhow to run it in VS 2008? PinmemberMember 151309912:53 5 Apr '10  
GeneralThanks need help Pinmembertnla8:27 9 Nov '09  
GeneralMy vote of 1 PinmemberWalxer9:44 2 Nov '09  
Generaldecrpter for data in SHA1/RSA format.mdb file Pinmemberoviis_4u4:40 3 May '09  
GeneralRe: decrpter for data in SHA1/RSA format.mdb file Pinmemberhebbiche11:17 26 May '09  
GeneralMy vote of 1 PinmemberKirk21128:54 21 Apr '09  
GeneralNeed help ! PinmemberHackmahesh7:52 4 Apr '09  
GeneralMy vote of 1 PinmemberZinkyu9:10 22 Dec '08  
Questionkamine kutte ye kya tha????????? Pinmemberanubhavkapuuri3:31 28 Nov '08  
Generali can't run program! Pinmembernguyenvanchinh12123:37 4 Nov '08  
QuestionHOW TO HANDEL 128 BIT KEY GENARETION Pinmembertandra islam7:56 21 Apr '08  
QuestionHow to handle 521 bit encryption/decryption PinmemberYiping Zou16:01 21 Jun '04  
GeneralDoesn't work for N less than the biggest ASCII code, which is Your default PinmemberMaxim Violin0:44 31 Jan '04  
GeneralRe: Doesn't work for N less than the biggest ASCII code, which is Your default PinmemberBhaskarBora22:53 13 Dec '04  
GeneralRe: Doesn't work for N less than the biggest ASCII code, which is Your default Pinmemberbygreencn16:48 10 Dec '06  
QuestionUsing linear search to check if a number is prime or not? PinmemberMustafa Demirhan8:39 6 May '03  
GeneralRe: 32 Bits!!! PinmemberNiklas Lindquist2:14 6 May '03  
GeneralRe: 32 Bits!!! PinmemberJörgen Sigvardsson6:06 6 May '03  
GeneralRe: 32 Bits!!! PinmemberKastellanos Nikos6:19 6 May '03  
GeneralRe: 32 Bits!!! PinmemberAntony Michael Kancidrowski23:25 12 May '03  
GeneralRe: 32 Bits!!! PinmemberShivian15:26 14 Jul '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 6 May 2003
Article Copyright 2003 by BhaskarBora
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid