Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
Available now!
Buy at Amazon US or
Buy at Amazon UK



Articles

1.Windows API reference
2.HTML to WML Converter
3.Webcam streaming in VB.NET
4.Remoting with firewalls
5.RSA from first principles
6.Key & MouseLogger in .NET
7.Networking Resource Kit for .NET
8.Automatic Reboot with .NET
9.XAML Schema
10.Migrating VB6 Winsock to VB.NET
11.Migrating C++ sockets to C#
12.RFC Reference guide
13.Lingua - Localization webservice
14.COM Reference guide
15.WMI Reference guide
16.SQL stored procedures
17.TCP & UDP port reference
18..NET Framework reference
19.Ethernet Type codes
20.IP to country webservice
21.MAC address assignments
22.DLL entry point reference
23.WHOIS server list
24. Turing Numbers
25. Boost SQL performance
26. Progress Bar in ASP.NET
27. OleDb WebService
27. Internet Explorer

Contact us

By visualizing the plaintext as a set of numbers, for instance the ASCII codes of each character, or group of characters. If we denote any given number in this sequence as m. The resultant cipher text is also a set of numbers, any of which is denoted by the variable c

From one of the Euler’s theorems, we know that for all integers m,

med = m (mod n)

Therefore, provided that 0 <= m < n,

med (mod n) = m

To encrypt a message m, we perform the following algorithm:

F(m) = me (mod n) = c where F(m) denotes the encryption algorithm.

To decipher the cipher text c with the private key d, we perform the following algorithm:

F(c) = cd (mod n) = med (mod n) = m1 (mod n) = m
where F( ) denotes the decryption algorithm.

The variable ‘e’ is known as the public key, and ‘d’ is the private key.

n’ is used in both encryption and decryption.

Sample application

This application demonstrates how to implement RSA in .NET from mathematical principles. It is important to note that character-by-character RSA encryption is just as susceptible to frequency analysis as any simple symmetric cipher. Therefore it is extremely important to pre-encrypt the message using cryptanalysis-resistant encryption, such as the book cipher. The symmetric key can be packaged along with the encrypted message prior to RSA encryption. This pre-encryption step is omitted from this example for simplicity.

Start a new project as before, and draw a form with 6 standard text boxes, and three multi-line textboxes. Name them, txtP, txtQ, txtPhi, txtE, txtN, txtD respectively. The three multi-line textboxes should be named txtPlain, txtEncrypt, and txtDecrypt

Drag three buttons onto the form; name them cmdKeyGen, cmdEncrypt, and cmdDecrypt

Add the following public variables to the code

Page 1   Page 3



Google

Free SMS UK Free SMS Ireland SMS Gratis Norway SMS Gratis Sverige Ilmainen SMS Suomi SMS Gratis Danmark SMS Tasuta Eestisse SMS Nemokamai Lietuva SMS Bezmaksas Latviju Darmowe smsy Polska SMS Zdarma Ceské SMS Zdarma Slovensko SMS Gratis Deutschland SMS Gratis Schweiz SMS Gratis Österreich SMS Gratuit Belgique SMS Gratis Nederland SMS Gratuit France SMS Gratis Espańa SMS Gratis Portugal Free SMS South Africa Free SMS USA SMS Percuma Malaysia Free SMS Hong Kong