Transposition ( railfence ) Cipher Encryption Technique. - Cyber security & Technology

Breaking

Wednesday, May 23, 2018

Transposition ( railfence ) Cipher Encryption Technique.





Implementation of transposition(railfence) cipher technique.


Concept: this way to encrypt data is used by trans-positioning data in rows.

For example: we have a plaintext CTUniversity and key is 3 then encryption will accur like this:-

C                                      I                                       S

          T                  N                 V                 R                  I                   Y

                    U                                     E                                      T       

And cipher text will written as- CISTNVRIYUET




C++ program:

#include<iostream>

#include<string.h>

#include<string>

using namespace std;



int main()

{

    int i,len,j=0,k=0;

    char plain[15],cip[15],str1[10],str2[10];

    cout<<"Enter Plain Text:";

    cin>>plain;

    cout<<endl;

    len=strlen(plain);

    for(i=0;i<len;i++)

    {

        if(i%2==0)

        {

            str1[j]=plain[i];

            j++;

        }

        else

            {

                str2[k]=plain[i];

                k++;

            }

        }

    j=0;



    cout<<"Str1:"<<str1<<endl<<"Str2:"<<str2;

}

Demo: I will perform a live web demo for railfence cipher.


   




·       Enter your plaintext

·       Give key for encryption

·       Press encrypt button

·       Output will be shown below in a box


Tools:











·       Railfence cipher in c or c++ language coding

 Resources:



·       https://www.dcode.fr/rail-fence-cipher                online performing




·       https://www.braingle.com/brainteasers/codes/railfence.php             online performing


·      http://www.hanginghyena.com/solvers/rail-fence-cipher-decoder          online performing




·       https://www.youtube.com/watch?v=27EgALog5Xk   youtube tutorial
https://en.wikipedia.org/wiki/Rail_fence_cipher

No comments:

Post a Comment