matlab coding for caesar cipher algorithm
#1

Looking for matlab coding for caesar cipher algorithm ?
Reply
#2
matlab coding for caesar cipher algorithm

Introduction Caeser Cipher

So this is Matlab code for Caesar Cipher Encryption and Decryption.There are many security techniques like Cryptography .The technique which was used in the past days is very simple and easily breakable in its method first a secret key is choosed after choosing key it added to every bit of data for example our data is Data = Attend meeting at noon and Encryption key = 3 so key is of single bit its mean its easily breable in 2.5ms So Now A = C , T = W , E=H , N=Q , D=G , M=P , I=L , O=R , G=j .Now apply this on data and then Ecrypted Data will be Cwwhqg phhwlqj cw qrrq . Now lets move towards how to develop Matlab code.

Algorithm

First Take Input Form user and then calculate Length of string then declare two dummy arrays named array and input.Now whats in the variable x ???? String ??? No actually x variable contains Ascii values of the string like ascii of ‘A’ is 65 and in the same way acsii of ‘B’ is 66 and the ascii of last alphabet ‘Z’ is 90. In the first loop to access single alphabet from the variable x and the result is saved i n input.
Now Select your Cipher Key which is also entered by user after then add the key value one by one in input1 variable and then save the result in array variable.
Now we have to handle both capital and small alphabets check if sum of ascii value and key is > than 122 (ascii of small z ) then its mean we have to shift our ascii values to start again from small z .To do this subtract array(i) for current alphabet from ascii of z (ascii =122) now add 96 to start from ‘a’ (ascii = 97) but we will add 96 becuase there will be an extra shift so upto now small alphabets are handles in the same way Capital letters are handled and in the decryption reverse process is done but if one has problem in understanding the handling of capital letters and in decryption then comment and ask about your problem.


Matlab Implementation

function ceaser

clc
x=input(‘Enter Input Text =’,’s’);

len=length(x);

array=[];
input1=[];
key = input( ‘Enter Key Value’);

for i=1:len
input1(i)=x(i);
end

for i=1:len
array(i)=input1(i)+key;

%handling small alphabets
if array(i)>122 && input1(i)>=97
array(i)=array(i)-122;
array(i)=array(i)+96;
end

%handling capital alphabets
if array(i)>90 && input1(i)<=90
array(i)=array(i)-90;
array(i)=array(i)+64;
end

end

disp(‘Ecryption Result’);
ENCRYPT = char(array)

for i=1:len
array(i)=array(i)-key;

%handling small alphabets in Decryption

if array(i)<=97 && input1(i)>=97
array(i)=97-array(i);
array(i)=123-array(i);
end

%handling capital alphabets

if array(i)<65 && input1(i)<=90
array(i)=65-array(i);
array(i)=91-array(i);
end
end

disp(‘Decryption Result’);

DECRYPT = char(array)

Source Code

Like , share this post on Facebook , Twitter by using left moving Social Sharing block and follow us on Facebook Page , Twitter and do comment and enter your email. After you have done you will automatically get source code in your mail. Note : This will be auto generated mail you can’t get until you follow above method.
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Tagged Pages: matlab caesar cipher,
Popular Searches: matlab codes for encryption of image using stream cipher, matlab code rc4 cipher, ascii banner, genetic algorithm cipher source code matlab, caesar cipher seminar introduction, ascii jolly roger, a5 1 cipher algorithm matlab code,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  how to calculate distance in heed protocol by using matlab 1 1,868 15-06-2018, 03:54 PM
Last Post: Guest
  matlab code for incremental conductance mppt 1 1,411 02-05-2018, 02:28 PM
Last Post: eksi
  anomaly detection code in matlab 3 2,074 23-04-2018, 12:04 AM
Last Post: Guest
  matlab code for liver tumor segmentation 2 1,574 01-04-2018, 06:29 PM
Last Post: [email protected]
  matlab code for vehicle tracking using unscented kalman filter 3 16,668 26-03-2018, 08:57 PM
Last Post: fodayj
  travel agency vb6 0 project report with coding in pdf format 3 3,194 13-03-2018, 12:15 AM
Last Post: Guest
  matlab code for facial expression recognition using frequency domain 1 2,664 19-02-2018, 06:03 PM
Last Post: Guest
  matlab code shadow detection and removal in colour images using matlab 2 2,241 12-01-2018, 01:24 PM
Last Post: dhanabhagya
  simulink matlab model upqc mdl 3 6,764 18-12-2017, 09:08 AM
Last Post: jaseela123d
  matlab code for speed breaker detection 1 1,285 27-10-2017, 10:22 AM
Last Post: Guest

Forum Jump: