Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Cryptography/Network Security

0.00/5 (No votes)
31 May 2006 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 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