A command line tool in Kotlin to help you encrypt/decrypt messages or files using a simple shifting algorithm.
The encryption is controlled by a key, a special parameter that controls the behavior of the encryption algorithm.
The key is assumed to mean that if a person knows the value of the key, they will be able to decrypt the text, and if they do not know it, they will not be able to decrypt the text. It's like a real key that can open up access to the message text.
The program parse these arguments from the command line:
The order of the arguments might be different. For example, -mode enc maybe at the end, at the beginning, or in the middle of the array.
shift
algorithm.shift
, only English letters are encoded — from "a" to "z" and from "A" to "Z". In other words, after "z" comes "a", after "Z" comes "A".unicode
, all non-letter characters are encrypted with the key as well as regular letters. There is no wrapping.encryption with the unicode algorithm
-mode enc -key 5 -data "Welcome to hyperskill!" -alg unicode
\jqhtrj%yt%m~ujwxpnqq&
decryption with the unicode algorithm
-key 5 -alg unicode -data "\jqhtrj%yt%m~ujwxpnqq&" -mode dec
Welcome to hyperskill!
encryption with the shift algorithm
-key 5 -alg shift -data "Welcome to hyperskill!" -mode enc
Bjqhtrj yt mdujwxpnqq!
decryption with the shift algorithm
-key 5 -alg shift -data "Bjqhtrj yt mdujwxpnqq!" -mode dec
Welcome to hyperskill!