File Exchange

image thumbnail

Caesar Cipher

version 1.4 (1.86 KB) by Nikesh Bajaj
This is Program for Caesar Cipher encryption Technique.


Updated 14 Nov 2014

View Version History

View License

This is one of the Classical encryption Algorithm, Not secure one but good for teaching.

Cite As

Nikesh Bajaj (2021). Caesar Cipher (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Marcianne Damatan

How to install and use this? I'm a matlab beginner. Please help

sonny christian

its doesnt work sir, variable k>26 always error it said undifined variable k, what can i do?thanks

Chun Ho Tao

Bebo Nassar


Sir I also created one but not a function like yours...preferred script file instead..but functions are still better to thanks Sir..:)

Nikesh Bajaj

@min min: It is a function not a code, it will not work till you pass P and k to it in command window

@Tamir: It depends on what name you have used to save this file, will be called by that name only,
I have used this code to even encrypt 100 pages of text file, it is working fine
this is the result for what you asked
P='Hello World and Welcome to Matlab cryptogrpahy'
C=Khoor Zruog dqg Zhofrph wr Pdwode fubswrjusdkb

Tamir Suliman

What I did notice is when you extend it above 3 words it doesnt do the shift so its missing that part
try to run this code and you will understand what I meant :

P='Hello World and Welcome to Matlab cryptogrpahy'

Tamir Suliman

It should work if you use the caesar_E instead of caeasar I think the help files didnt express well how to use the function but its good try

Mr Smart

didn`t work...sir

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!