Reputation: 1033
I'd like to create a bash script to encrypt my personal (text) files, and decrypt them when I need them.
The encryption method I want is, to convert all ASCII characters to hex, then add a value, and convert back to ASCII.
The value to add should be the hex value of a certain character in the file - based on it's position, so it would vary depending on what character happens to be there.
I know next to nothing about bash scripting and about Linux at all for that matter, can anyone please help me?
Upvotes: 0
Views: 1495
Reputation: 35905
Unless you trying to learn the history of cryptography forget about this. Anyone with limited knowledge of cryptography will break your code in minutes. A determined hacker will break this in seconds (using frequency analysis of single letters, doublets and triplets).
For encryption (approach you described can hardly be called encryption. It is rather cipher), use stable, proven algorithms (AES, 3DES, TwoFish, Serpent) and tools, such as GPG, TrueCrypt.
Upvotes: 4