🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.security
Article #63876

Re: AES przyk³ad

#63876
From: Szymon Sokół
Date: Tue, 21 Jul 2009 22:17
26 lines
2415 bytes
On Tue, 21 Jul 2009 18:56:26 +0200, Miron A. Kajfasz wrote:

> Co robie nie tak? Jak sprawdzić czy czegoś nie pominąłem?
Obstawiam, że przede wszystkim nie doczytałeś man enc:

When only the key is specified using the -K option, the IV must explicitly
be defined. When a password s being specified using one of the other
options, the IV is generated from this password.

Ty używasz -k, nie -K, więc IV będzie generowane na podstawie hasła - czytaj
nie będzie równe 0. Jeśli dasz "-iv 0", wynik będzie zgoła inny niż przy
zupełnym braku -iv. Różnica między -k i -K też Ci umknęła? Bo:

echo -n "ABCDEFGHIJ" | openssl enc -aes-128-cbc -nosalt -iv 0 -K
"0123456789abcdef0123456789abcdef" | od -tx1

daje "9af89a43d766101649f03b3c4727a942", tak jak chciałeś (i zamiast
"hexdump" używaj "od -tx1", bo inaczej się natniesz na problem NUXI -
hexdump jest równoważny "od -x", które z kolei odpowiada "od -tx2").


-- 
Szymon Sokół (SS316-RIPE) -- Network Manager                                 B
Computer Center, AGH - University of Scienice and Technology, Cracow, Poland  O
http://home.agh.edu.pl/szymon/ PGP key id: RSA: 0x2ABE016B, DSS: 0xF9289982  F
Free speech includes the right not to listen, if not interested -- Heinlein  H
Technical Details
Message-ID: <1387qnczz830g$.dlg@falcon.sloth.hell.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!newsfeed.neostrada.pl!news.underley.eu.org!moderators!marcinw
References: <h44s3r$hf1$1@atlantis.news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!newsfeed.neostrada.pl!news.underley.eu.org!moderators!marcinw
From: Szymon Sokół
 <szymon@bastard.operator.from.hell.pl>
Newsgroups: pl.comp.security
Subject: Re: AES przyk³ad
Date: Wed, 22 Jul 2009 00:17:39 +0200
Organization: Guy Fawkes Society
Lines: 26
Message-ID: <1387qnczz830g$.dlg@falcon.sloth.hell.pl>
References: <h44s3r$hf1$1@atlantis.news.neostrada.pl>
NNTP-Posting-Host: ghostwheel.underley.eu.org
Mime-Version: 1.0
X-Trace: news.agh.edu.pl 1248214879 17427 89.79.214.187 (21 Jul 2009 22:21:19 GMT)
X-Complaints-To: abuse@agh.edu.pl
NNTP-Posting-Date: Tue, 21 Jul 2009 22:21:19 +0000 (UTC)
User-Agent: 40tude_Dialog/2.0.15.1 Hamster/2.1.0.11
X-Moder-Tool: ModerGate.pl v3.0 (c) 2008 Daniel Podlejski
X-Orig-NNTP-Posting-Host: chello089079214187.chello.pl
X-Orig-Newsgroups: pl.comp.security
Approved: marcinw.pcs@gmail.com
X-Post-Key: c38729618f0679e5d8e3e1dc662b0dab
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit