Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / C#
Article

Classic Encryption

Rate me:
Please Sign up or sign in to vote.
1.00/5 (12 votes)
11 Oct 2004 39.1K   361   8   2
This code implements classic encryption technique in an easy and reusable way.

Introduction

The code implements a classic encryption technique to be reused in other project where security required is of intermediate level.

The algorithm write the given string in a 2-D array whose columns are based on the length of the key. Then the string is read on a column by column basis in the order of the key.

For example if the string to encode is "ThisWorldIsAMystery" and key is 34125 then the 2D array will be created like:

ThisW
orldI
sAMys
teryx

some characters are appended at the end to fill the array.

It will be read like this, 1st column, 2nd column, 3rd column and so on. The encoded string will become "ilMrsdyyTosthrAeWIsx".

The decryption will definitely be its reverse :)

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


Written By
Software Developer
Australia Australia
C/C++, C# .NET, VB.NET, Linux, Oracle, PostgreSQL, MYSQL

Comments and Discussions

 
GeneralOnce again Pin
Paul Ingles12-Oct-04 2:12
Paul Ingles12-Oct-04 2:12 
Generalsecurity level "homework" Pin
Corinna John12-Oct-04 2:05
Corinna John12-Oct-04 2:05 

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.