Use gpg :
gpg -c --cipher-algo twofish --passphrase=123 myfile
-
-c: criptografa com uma cifra simétrica usando uma frase secreta. -
--cipher-algo: twofish -
--passphrase=123: defina as partilhas passadas para 123 -
filenome do arquivo
Em seguida, verifique o tipo de arquivo:
$ file myfile.gpg
myfile.gpg: GPG symmetrically encrypted data (TWOFISH cipher)
Para stdin você pode simplesmente pipar para gpg :
echo hi bla bla | gpg -c --cipher-algo twofish --passphrase=123 > file.gpg
ou para uma variável:
gpg -c --cipher-algo twofish --passphrase=123 > file.gpg <<<"$var"