Click here to Skip to main content
Click here to Skip to main content

Cryptography/Network Security

, 31 May 2006
Rate this:
Please Sign up or sign in to vote.
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)

About the Author

Muhammad Adeel Malik
Web Developer
Pakistan Pakistan
No Biography provided

Comments and Discussions

 
GeneralWrapper program PinmemberMichael Hendrickx14-Oct-06 21:55 

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.

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 1 Jun 2006
Article Copyright 2006 by Muhammad Adeel Malik
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid