Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #227875

Re: OpenSSl encrpt and decrypt a String

From Reco <recoverym4n@enotuniq.net>
Newsgroups linux.debian.user
Subject Re: OpenSSl encrpt and decrypt a String
Date 2020-10-16 18:20 +0200
Message-ID <B0ACu-7u9-5@gated-at.bofh.it> (permalink)
References <B0yr0-60c-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


	Hi.

On Fri, Oct 16, 2020 at 03:58:46PM +0200, Philipp Ewald wrote:
> echo -n "That's the text" | openssl enc -aes-256-cbc -a -A -nosalt
> 
> gives me following "String":
> ttn39k7YiglePLvmmc6s+w==

Correct so far, assuming that you've entered a passphrase from the
keyboard.


> echo -n "ttn39k7YiglePLvmmc6s+w==" | openssl base64 -d | openssl enc -d -aes-256-cbc

Wrong one. By default openssl assumes that plaintext is salted before
the encryption.


> echo -n "ttn39k7YiglePLvmmc6s+w==" | openssl base64 -d | openssl enc -d -aes-256-cbc -nosalt

That one worked for me, but I've used a different passphrase, so the
ciphertext was different:

$ echo -n "That's the text" | openssl enc -aes-256-cbc -a -A -nosalt -k foo 2>/dev/null
3zGGAzM31Vsu9cax67TUrw==
$ echo -n 3zGGAzM31Vsu9cax67TUrw== | base64 -d | openssl enc  -d -aes-256-cbc -nosalt -k foo 2>/dev/null
That's the text
$ openssl version
OpenSSL 1.1.1d  10 Sep 2019

Reco

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OpenSSl encrpt and decrypt a String Philipp Ewald <philipp.ewald@digionline.de> - 2020-10-16 16:00 +0200
  Re: OpenSSl encrpt and decrypt a String Reco <recoverym4n@enotuniq.net> - 2020-10-16 18:20 +0200
    Re: OpenSSl encrpt and decrypt a String Philipp Ewald <philipp.ewald@digionline.de> - 2020-10-16 18:30 +0200
      Re: OpenSSl encrpt and decrypt a String Reco <recoverym4n@enotuniq.net> - 2020-10-16 19:40 +0200
  Re: OpenSSl encrpt and decrypt a String l0f4r0@tuta.io - 2020-10-16 22:40 +0200

csiph-web