Welcome to www.programmer2programmer.net Its all about security programming source code

programmer2programmer.net

 Tips
 Microsoft Certification
 Final Year Project Idea
 Connection Strings
 Password Recovery
 SQL Injection
 Encryption & Decryption
  
 LIVE Academic Project
 Project #1 - VB6, Access
  Project #2 - VB.Net, SQL
 Project #3 - ASP, Access
 Project #4 - ASP.NET, C#
 Project #5 - VB6, SQL
 Project #6 - Stegano
 Project #7 - C
 Project #8 - C++
 Project #9 - JAVA, MySQL
 Project #10- PHP, MySQL
 Project #11- JSP, Oracle
 Project #12- C# Face Exp
 Project #13- Mobile Bank
 Download MBA Project
 MBA Project Topic
 Project Viva Question
  2017 New Projects
 Project Synopsis Download
  
 University Question Paper, Assignment and Projects
 SMU - Question Paper
 SMU - Assignment
 SMU - Synopsis Projects
 SCDL - Assignment
 IGNOU - Synopsis Projects
 Welingkar - Projects
 Project Report Formats
  
 Interview Question Answer
 General & HR Round
 Visual Basic 6
 VB.Net & C#
 ASP.Net
 SQL Server
  Oracle and DBA
 My SQL
  

100% Tested
Ready Academic IT Projects

BE, ME, BTech, BCA, MCA, MBA, Bsc-IT, MS, BIT, ADIT, DOEACC, IGNOU, SMU
readymadeproject.com

  Encryption and Decryption, Transposition Encryption, Geometrical Pattern Encoding, VB Security Code

Home Personal Member Forum Source Project Tips Contact
 

 

Encryption and Decryption

Transposition Encryption

1. Encryption / Decryption

 

Transposition ciphers are based on the rearrangement of each character in the plain text message to produce a cipher text, These encryption technique include reversing the entire message, reforming the message into a geometrical shape, rearranging the plain text by scrambling a sequence of columns, and periodically permuting the character of the plain text.

Message Reversal
Encryption using message reversal means that the plain text is written backwards to producer a ciphertext, If the plain text message is.
    WELCOME TO MY WEB SITE

2. XOR Encryption

3. Transposition Encryption

4. Symmetric Encryption
5. Asymmetric Encryption
6. Certificate Authority
7. Decryption Logics
8. Sample Coding

Then the encrypted message reads
    ETIS BEW YM OT EMOCLEW

This is one of the simplest encryption technique, obviously it is not very secure, since the cracker it one merely reads cipher text in reverse

Here we are creating a function named MessageReversal which takes one argument StrDataIn, it iterate each character from reverse of the supplied string and concatenate output in StrOut variable, after completing the loop it return the reverse string.

    Private Function MessageReversal(ByVal StrDataIn As String)

        Dim StrOut As String

        StrOut = ""

        Dim I As Integer

        For I = Len(StrDataIn) To 1 Step -1

            StrOut &= Mid(StrDataIn, I, 1)

        Next

        MessageReversal = StrOut

    End Function

If we call function MessageReversal("ATANU MAITY") then it returns cipher text "YTIAM UNATA", same way if we call MessageReversal("YTIAM UNATA") then it returns plain text "ATANU MAITY".



Geometrical Pattern Encoding

In geometrical pattern encoding the message is rearranged with the aid of some type of geometric figure, a typical example being a two - dimensional array or a matrix, First plain text message is written into the figure according to a particular matrix, the cipher text then created by taking the letters off the matrix according to a different path, for example suppose the plain text word,

   MESSAGEREVERSAL is written into a 3*5 matrix

Column Number

1

2

3

4

5

Cipher Text

M

S

E

V

S

E

A

R

E

A

S

G

E

R

L


If the letters are taken off by columns in the order 4,3,5,1,2 other than 1,2,3,4,5 then resulting cipher text will be VEREREEALMESSAG.
You can rearranged the cipher text almost Factorial of number of column way, for example if you have 5 column then you can rearrange cipher text in 5!=120 different way, You can also rearrange cipher text by rows also or both row and column also. For a long message the actual encrypted message would be sent as a continuous stream of characters to hide the encryption periodicity.

Here we are creating one function called MessageTransposition it takes two argument, one is input text and second one is a Boolean switch which determine whether this function is perform encryption or decryption. It first convert supplied string into 2*3 matrix and rearrange the text with 2,0,1 column order. and for decryption it reverse the order.

    Private Function MessageTransposition(ByVal StrDataIn As String, _

    ByVal ED As Boolean)

        Dim DataArray(2, 3) As String ' 2*3 matrix

        Dim i As Integer

        Dim r, c As Integer

        Dim StrOut As String

        StrOut = ""

        r = 0 'row index

        c = 0 'column index

        For i = 1 To Len(StrDataIn)

            DataArray(r, c) = Mid(StrDataIn, i, 1)

 

            r = r + 1 'increment column index

            If r > 1 Then

                r = 0

                c = c + 1 'increment row index

            End If

            If c >= 3 Or i = Len(StrDataIn) Then

                r = 0

                c = 0

                'its time to send data to strout

 

                Dim k, l As Integer

                If ED = True Then

                    'encrypt order 2,0,1

                    k = 2 'change the column position

                    For l = 0 To 1

                        StrOut = StrOut & DataArray(l, k)

                    Next

                    k = 0 'change the column position

                    For l = 0 To 1

                        StrOut = StrOut & DataArray(l, k)

                    Next

                    k = 1 'change the column position

                    For l = 0 To 1

                        StrOut = StrOut & DataArray(l, k)

                    Next

                Else

                    'decrypt order 1,2,0

                    k = 1 'change the column position

                    For l = 0 To 1

                        StrOut = StrOut & DataArray(l, k)

                    Next

                    k = 2 'change the column position

                    For l = 0 To 1

                        StrOut = StrOut & DataArray(l, k)

                    Next

                    k = 0 'change the column position

                    For l = 0 To 1

                        StrOut = StrOut & DataArray(l, k)

                    Next

                    'clear the fill character

                    StrOut = Replace(StrOut, Chr(1), "")

                End If

 

 

                'clear the array

                For k = 0 To 2

                    For l = 0 To 1

                        DataArray(l, k) = Chr(1)

                    Next

                Next

            End If

 

        Next

        MessageTransposition = StrOut

 

    End Function


For example if we call the function MessageTransposition("MICROSOFT VISUAL STUDIO DOT NET",True) then it will encrypt the text at returns output like "OSMICRVIOFT SSUALO TUDINEDOT T".

and for decryption if you call the function MessageTransposition("OSMICRVIOFT SSUALO TUDINEDOT T",False) then it decrypt the text and return plain text "MICROSOFT VISUAL STUDIO DOT NET"

For completing listing of the code and sample Visual Basic  project for Transposition Encryption can be found in Sample Code section.


Next 4.  Symmetric Encryption

(C) Atanu Maity, 2006-2017