Click here to Skip to main content
15,885,309 members
Articles / Mobile Apps

Cryptography/Network Security

Rate me:
Please Sign up or sign in to vote.
3.00/5 (24 votes)
31 May 2006CPOL 39.1K   2K   15   1
Cryptography Techniques(HASH,Asymmetric Cryptography,Symmetric Cryptography)

Introduction

This is class library which contains cryptography techniques

  • Asymmetric
  • Symmetric
  • Hash

These techniques also apply on files and text messages

Asymmetric Class

First we generate Keys

AsymmetricCryptography asy = new AsymmetricCryptography();

prk = asy.Private_Key;

pk = asy.Public_Key;

txtpk.Text=pk;
  • public keys
  • private keys
  • and then two static fucntion

Encrypt

AsymmetricCryptography asy = new AsymmetricCryptography();

asy.Private_Key = prk;

asy.Public_Key=pk;

txtcipher.Text = AsymmetricCryptography.Encript(txtplain.Text,asy.Public_Key);

And Decript

AsymmetricCryptography asy = new AsymmetricCryptography();

asy.Private_Key = prk;

asy.Public_Key=pk;

txtplain.Text = AsymmetricCryptography.Decript (txtcipher.Text,asy.Private_Key );

Symmetric Class

SymetricCryptography sym = new SymetricCryptography();

Initialization Vector

iv = sym.Initialization_Vector;

Session Key

sk = sym.Sessio_Key;

This is used to encrypt and decrypt files and texts

Encrypt

SymetricCryptography sym = new SymetricCryptography();

sym.Initialization_Vector = iv;

sym.Sessio_Key = sk;

txtcipher.Text= sym.EncryptString(txtplain.Text);

Decrypt

SymetricCryptography sym = new SymetricCryptography();

sym.Initialization_Vector = iv;

sym.Sessio_Key = sk;

txtcipher.Text= sym.EncryptString(txtplain.Text);

Hash Funtion

The hashcalulatore class uses the MD5 Hash function

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Pakistan Pakistan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralWrapper program Pin
Michael Hendrickx14-Oct-06 21:55
Michael Hendrickx14-Oct-06 21:55 

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

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