Linux string encryption

Can someone tell me how I can take a string with 16 characters and create an encrypted string with 16 characters (in human readable format) using command line tools.

I have studied options like openssl, but I cannot control the length of the output.

Can anyone consult?

+3
source share
3 answers

Below is a description of ROT13 on Linux here . I have not tested it:

$alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"

It can satisfy your needs, although it is not safe at all.

+3
source
echo "abcdefghijklmnop" | gpg --armor -c --output -

However, this will not break into your 16-digit limit.

Result:

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.10 (GNU/Linux)

jA0EAwMCnM6hI0xpVVFgyScCfr6Zo2fZeuiVWteZKeptcvSBj9wxk2gRMqTERtz9
8dNUHZq2eRA=
=Jpku
-----END PGP MESSAGE-----
+2
source

, , , . :

  • ;
  • ;
  • .

, . , , , Linux/Unix. - , , , "". HEX (base16) base64, ( , "UtahJarhead" " doen N" ).

( ):

  • ( , ROT13, , - , Vigenère, );
  • AES ( OpenSSL, ), base64 ;
  • AES ( OpenSSL), , - .

: - - , , ...

edit: , , , . , ascii n , , [1].

, , "" (, ), .

[1] Some cryptologists will disagree that you may consider the output of the hash function to be "random" (you would use the "Random Oracle Model"). The hash coding should be such that, provided that the bits are evenly distributed at the input, there is a uniform distribution of letters as output. When you combine this “pad” with the message, it should be a one-to-one mapping, so the distribution of the final result is uniform.

0
source

All Articles