Any way to encrypt a text

any way to encrypt a text with a password? (im not talking about files, or text file, encrypt just the text)

6 Likes

You’ll need to use an app such as Signal, Wickr, etc and so will the other user.

Technically speaking if you both use iMessages your chat is encrypted as well.

4 Likes

Im talking about literally texts.
(sorry if u misunderstood, as i said im not talking about files, or text files - such as chat logs that r files obviously so apps isnt what im talking about too)

4 Likes

If you are familiar with GnuPG and the command line, you can try this:

echo “your text here” | gpg -ca

For decryption:

echo “ciphertext” | gpg -d

NOTE: both commands will spit output to STDOUT

7 Likes

well, when i do the gpg encrypt i get a lot of lines so how i will add them to decrypt? any examples please ?

6 Likes

I would run gpg --decrypt and then paste the encrypted block in and do one empty line after it and press CTRL + D and it should ask for decryption password or key password depending how you encrypted it.

7 Likes

its not block its like multi lines so when i paste them in cmd it just ruin things so yeah i want an actual example like: for decrypt do echo “test” | gpg -ca and for decrypt do echo “ciphertext” | gpg -d so my problem at “ciphertext” what or how i paste the encrypted msg in it
–
EDIT: nvm next time i will talk after try :joy: not before & it worked thx!

6 Likes

You can also just type cat file-with-encrypted-text | gpg -d. On Windows, the cat command is type.

5 Likes

well, what if i want encrypt text with private key of another friend not just add my own password, how do it ?

5 Likes

Encryption/decryption: Normally, you should never own the private key of your friend but only the public key. You then use the public key of your friend to encrypt a message for him/her. Since your friend is the only one owning the private key, only he/she will be able to decrypt the message using the private key.

Signing/verification: Contrary to this, you use your own private signing key to cryptographically sign a message. Then, your friend uses your public signing key to verify that you signed the message.

Maybe, you mean something like
cat clear.txt | gpg -esar [public-key-id-of-your-friend] -u [your-signing-key-id] > cipher.txt. This command combines encryption using your friend’s public key and signing using your private signing key.

See also here.

7 Likes

im trying it so until see its results, thx for help!