summaryrefslogtreecommitdiff
path: root/3544/CH2/EX2.11/Ex2_11.sce
blob: 12d3f8135fe7a0681c534f74535f6680cac5121c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Example of breaking 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)

key = 3
a = ascii('A')
ct = "L ORYH BRX"
printf("Encrypted text:\n\t%s\n",ct)

//Decryption using function from dependency file
printf("Plaintext:\n\t%s",decrypt_caesar(ct))