Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.076 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'differently': 0.07; '24,': 0.16; '6:30': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'it;': 0.16; 'operation,': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'meant': 0.20; 'reset': 0.22; 'text.': 0.24; 'right.': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'mode': 0.30; 'message-id:@mail.gmail.com': 0.30; 'subject:what': 0.31; 'quite': 0.32; 'text': 0.33; 'no,': 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'matter': 0.61; 'times': 0.62; 'email,': 0.69; 'stated': 0.69; 'world!"': 0.84; 'state.': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ec+WoBDAvpCV/bx+7Ow0HhWarFTVSilnQo2JTsZwF1w=; b=NGtc7ugNHaoUMB0z/MlUnT4BdZycsSdlTZNB/lqIT+ICIB6AXB7+eErv/mC0oSQqOX EAP5ttTQNeT5G2z/w74RPHlx0y/CWxV/Wf3bf7YJeJoPu+03knEgdT3xzSIrjmOYDt84 6dYuEA3vXJwyltcZ2EmeX5u1g/A1Wm0KkVKJh/U2spUpwoCSHISyTj93BieX0nTJjuck Wvr+u2wA4m101rxjF7qOvNh61yWFLETH9OnF/uWZCc63X8LUSR0e7Mn8KfL+8Dghc3f6 z52d11lu2y+oj/ipiq96yXE0gjFMKiYQvcv510Uxl7tPnIClPoUpVa5TprE/L98Codm7 HHJA== MIME-Version: 1.0 X-Received: by 10.68.197.36 with SMTP id ir4mr1508797pbc.96.1382600601555; Thu, 24 Oct 2013 00:43:21 -0700 (PDT) In-Reply-To: References: <97dbe3cc-b739-4876-9221-1143dc1b8c73@googlegroups.com> Date: Thu, 24 Oct 2013 18:43:21 +1100 Subject: Re: pycrypto: what am I doing wrong? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382600610 news.xs4all.nl 15941 [2001:888:2000:d::a6]:50497 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57428 On Thu, Oct 24, 2013 at 6:30 PM, Johannes Bauer wrote: > On 24.10.2013 09:07, Chris Angelico wrote: >> AES is a stream cipher; > > No, it is definitely not! It's a block cipher! However, since he uses > CFB mode of operation, it behaves like a stream cipher. Sorry! Quite right. What I meant was, it behaves differently based on its current state. The SHA256 of "Hello, world!" is 315f5b...edd3 no matter how many times you calculate it; but the AES-encrypted text is going to change based on the previously-encrypted text. Hence the need to either, as stated in your other email, reset the internal state, or, as stated in my previous one, treat it as a stream. ChrisA