Code archives/Algorithms/Caesar's crypting -decrypting algorithm

This code has been declared by its author to be Public Domain code.

Download source code

Caesar's crypting -decrypting algorithm by jankupila2010
Caesar's crypting -decrypting algorithm
Strict

Global message:String="Blitzmax programming is fun... Blitzmax programming is fun..."

Local length:Int = message.length


Local k:Int
Local key:Int=6
Local crypted:String=""
Local solved:String=""

' crypting
For k=1 To length  
	Local character_num=Asc(Mid(message,k,1))+key
	crypted=crypted+Chr(character_num)
Next

'decrypting
For k=1 To length
	Local character_num=Asc(Mid(crypted,k,1))-key
	solved=solved+Chr(character_num)
Next

Print message
Print crypted
Print solved

Comments

slenkar2010
good one


Code Archives Forum