summaryrefslogtreecommitdiff
path: root/3544/CH2/EX2.5/Ex2_5.sce
blob: 9952253383968dd49b4c1bebf2ca1743b0809c29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Substitutition scheme of Caesar cipher

// Move scilab to current file directory
[u,t,n] = file()
n = strcat(n)
file_name = basename(n)+fileext(n)
file_name = strcat(file_name)
ind=strindex(n,file_name)
path = part(n,1:ind-1)
chdir(path)

exec("Chapter_2.sci",-1)

a = ascii('A')
for i =0:25
    printf("%c : %c\n",ascii(a+i),encrypt_caesar(ascii(a+i)))
end
// A scheme for codifying messages 
//(replacing each alphabet with an alphabet three places down the line)