Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'basic encrypt/decrypt by Dominic McGough 1/12/2012
- start:
- TextWindow.Write("Encrypt [e] or decrypt [d]?: ")
- choice = TextWindow.Read()
- If choice = "e" Then
- encryptedString = ""
- TextWindow.Write("Enter the original string to encrypt: ")
- unencryptedString = TextWindow.Read()
- For i = 1 To Text.GetLength(unencryptedString)
- unencryptedArray[i] = Text.GetSubText(unencryptedString,i,1)
- encryptedArray[i] = Text.GetCharacterCode(unencryptedArray[i])+2
- encryptedString = Text.Append(encryptedString,Text.GetCharacter(encryptedArray[i]))
- EndFor
- TextWindow.WriteLine(encryptedString)
- Else
- decryptedString = ""
- TextWindow.Write("Enter the encrypted string to decrypt: ")
- preencryptedString = TextWindow.Read()
- For i = 1 To Text.GetLength(preencryptedString)
- preencryptedArray[i] = Text.GetSubText(preencryptedString,i,1)
- decryptedArray[i] = Text.GetCharacterCode(preencryptedArray[i])-2
- decryptedString = Text.Append(decryptedString,Text.GetCharacter(decryptedArray[i]))
- EndFor
- TextWindow.WriteLine(decryptedString)
- 'For i = 1 To Text.GetLength(preencryptedString)
- EndIf
- TextWindow.Write("Do you wish to go again?: ")
- again = TextWindow.Read()
- If again = "y" Then
- Goto start
- Else
- Program.End()
- EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement