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


 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#
 SQL Server
  Oracle and DBA

100% Tested
Ready Academic IT Projects


 Decryption logics, finding and cracking the private secret key, XOR key finder Visual Basic source code

Home Personal Member Forum Source Project Tips Contact

Encryption and Decryption

Decryption Logics - How to crack the private secret code ?

1. Encryption / Decryption

Now the tough thing, You have the encrypted chipper text and you want to decrypt the text. however you don't know the secret key by which it encrypted.  There is no predefined formula for find the secret key. It is an art and normally known as cryptography or reverse engineering.

You can follow some basic guide line to find the secret key.
   1. Try to find the pattern of repetitive character.
   2. If it is a database field try with numeric field.
       as the range will be (0-9)
   3. Try with each key and find the output in most readable format.
   4. If it is a long text or paragraph most probably it encrypted with
       XOR Encryption because it is fast to execute.
   5. If you have the Encryption Program try to create more chipper text
       with same plain text, and if you have same identical output each
       time then try to find the encryption pattern.

2. XOR Encryption

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


NOTE : I have no intension to encourage or share knowledge how to crack or decrypt the cipher text or secret keys, I only want you should know how to built more robust secure algorithm to encrypt or protect your data. do not attempt to crack any private encrypted data or secret keys, I will not take any responsibility if any damage or destruction happen by using any encryption or decryption logics described in my site. 

Time required for find any secret key depend upon the secret key length and algorithm used. The actual time depends on the key length other than the algorithm used. For finding the secret key you need four basic thing Time, Logics, Patients and Motivation. I heard one probe "Locks are not made for Thief" it means locks are made for normal and honest people not for the thief. It is very much true in the cryptography world. Encrypted or chipper text are for normal and honest person and not for the professional and motivated hacker.

Following example I will show you how to find a secret key for XOR Encrypted text. It is a very basic example and real world decryption process totally different thing altogether. I also provide complete source code for Automatic Secret Key finder for XOR Encryption. You can download the project file from sample code section.

Finding the Secret Key or Private Key for XOR Encryption

I have the following text and I want to know the Secret key by which it originally encrypted.


First I have to create a Readable text stream and stored it into a string variable.
StrPT As String

Now I need to XOR Each character of Encrypted text with a code range from 1 to 255 and stored it into separate variable probably an array and compare each decrypted string with our readable text streams and give a rank for each decrypted text.

Declare an Array to hold all Secret key, Decrypted Text and Rank.
   Dim DecrArray(255, 3) As String

Now XOR Each character of the Encrypted text and create decrypted text and compare it with the Readable text stream and give the rank and stored it into the array.

        Dim StrPT As String
        Dim StrET As String
        StrET = "íÒŽ€áÔÁÎÕ€íÁÉÔÙŒ€íãóäŽîåô"
        Dim DecrArray(255, 3) As String
        Dim i As Integer
        For i = 1 To 255
            Dim TempDE As String
            TempDE = XORCipher(StrET, i)
            '>>> compare to ReadableText
            Dim j As Integer
            Dim r As Integer
            r = 0
            For j = 1 To TempDE.Length
                If InStr(StrPT, Mid(TempDE, j, 1)) > 0 Then
                    r = r + 1
                End If
            '>>> decrypted text
            DecrArray(i - 1, 0) = TempDE
            '>>> XOR/ Secret Key
            DecrArray(i - 1, 1) = i
            '>>> rank
            DecrArray(i - 1, 2) = r

            Debug.WriteLine(DecrArray(i - 1, 0) & vbTab & vbTab
            & DecrArray(i - 1, 1) & vbTab & vbTab & DecrArray(i - 1, 2))


If you run the program it will display following text in your debug window, Now you need to sort the array by rank in descending order to get Probable plain text. You can see by naked eye what is the decrypted text in this case and you also found the secret key that is 160.

      Decrypted Text           Secret Code      Rank
 ìӏàÕÀÏԁìÀÈÕ؍ìâòåïäõ         1             0
 ïÐŒ‚ãÖÃÌׂïÃËÖÛŽ‚ïáñæŒìçö         2             0
 îэƒâ×ÂÍÖƒîÂÊ×ڏƒîàðçíæ÷         3             0
 éÖŠ„åÐÅÊÑ„éÅÍÐ݈„éç÷àŠêáð         4             0
 è׋…äÑÄËÐ…èÄÌÑ܉…èæöá‹ëàñ         5             0
 ëÔˆ†çÒÇÈÓ†ëÇÏÒߊ†ëåõâˆèãò         6             0
 ……………………… ………………………………………………………………………………………………………
 sL__J_PK_s_WJG__s}mz_p{j         158           14
 rM__~K^QJ_r^VKF__r|l{_qzk         159           14

 Mr. Atanu Maity, MCSD.NET         160           22

 Ls/!@u`ot!L`hux-!LBRE/ODU         161           17
 Op,"Cvclw"Ockv{."OAQF,LGV         162           21
 Nq-#Bwbmv#Nbjwz/#N@PG-MFW         163           20

You can find complete source code for the above algorithm in source code section. Click Here to download the XOR Decryption and Secret Code finder in VB 6 and Visual Basic .NET.

How to Create Better Encryption Algorithm.
It is not possible to create any secret code that can not be break. However you can combine more than one algorithm to make the encrypted text which is near to impossible to break.

Next 8.  Sample Source Code
(C) Atanu Maity, 2006-2017