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

Classic Encryption

0.00/5 (No votes)
11 Oct 2004 1  
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