0

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?

4
  • 6
    gpg -c filename would be a much better way - your encryption could be broken very easily by frequency analysis Commented Sep 30, 2013 at 16:36
  • I think you need to read this: security.stackexchange.com/questions/18197/… Commented Sep 30, 2013 at 16:40
  • what you're attempting to do isn't encryption, it's cipher. Commented Sep 30, 2013 at 17:05
  • The other problem with this is you're going to have a script named super_secret_encrypt.sh lying around that will easily show an attacker how to bypass your 'encryption'. Use GPG. Commented Sep 30, 2013 at 17:10

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Silly me, but I still want it! Can anyone please help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.