Deutsch   English   Français   Italiano  
<v6flab$n028$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Rich <rich@example.invalid>
Newsgroups: sci.crypt
Subject: Re: HMAC cipher and a TRNG...
Date: Mon, 8 Jul 2024 03:10:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <v6flab$n028$1@dont-email.me>
References: <v69m0j$3e2id$1@dont-email.me> <v69vjv$3fu1v$1@dont-email.me> <v6cclq$3veiq$1@dont-email.me> <v6cemu$3vkt2$1@dont-email.me> <v6eqj8$f608$1@dont-email.me>
Injection-Date: Mon, 08 Jul 2024 05:10:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="649b734433f5eb74ab2c403ed8e138ef";
	logging-data="753736"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/Faf9LW4ENHR0R94W98nOe"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:fRYKzig9p3azeWvHrrKlLeKfX9g=
Bytes: 3062

Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
> A compromised secret password is bad.  I was just interested if I 
> could create different ciphertexts for the same plaintext and 
> password, as an experiment.  See?

Slightly revisionist history.

IIRC you were worried about having all bits of the plaintext change if 
any one bit of the ciphertext was changed by Eve.

Because if all you were worried about was different ciphertexts from 
same key and plaintext, that is already available from standard 
constructions.  Note this short example:

    #!/usr/bin/tclsh

    package require aes ;# aes encryption module

    proc hexdump {value} {
      binary scan $value H* hex
      return $hex
    }

    set fd [open /dev/urandom {RDONLY BINARY}]

    # IV #1
    set iv1 [read $fd 16]

    # IV #2
    set iv2 [read $fd 16]

    # key
    set key [read $fd 16]

    # plaintext
    set pt [read $fd 32]

    # ciphertext #1
    puts "before creating ciphertext #1"
    puts key=[hexdump $key]
    puts "pt =[hexdump $pt]"
    set ct1 [aes::aes -mode cbc -dir encrypt -key $key -iv $iv1 $pt]

    # ciphertext #2 - same plaintext and key
    puts "before creating ciphertext #2"
    puts key=[hexdump $key]
    puts "pt =[hexdump $pt]"
    set ct2 [aes::aes -mode cbc -dir encrypt -key $key -iv $iv2 $pt]

    # display cipher texts
    puts ct1=[hexdump $ct1]
    puts ct2=[hexdump $ct2]

This uses AES, and CBC mode.  Running the above code (assuming you have 
Tcl and Tcllib installed, results in:

    before creating ciphertext #1
    key=5726ed430f6b2f4ec4c18e68d77385a2
    pt =e17752182f07dd0239ce09308b6f4912a043567f0df79fb176baf996d0772e4c
    before creating ciphertext #2
    key=5726ed430f6b2f4ec4c18e68d77385a2
    pt =e17752182f07dd0239ce09308b6f4912a043567f0df79fb176baf996d0772e4c
    ct1=ee68def5cb2978215356b585fe87d74a99a7786c08c6559594c82d0102c258b2
    ct2=ae0b908dc7049a4608e57cd94249d00850b63ae1d1b9d4416fb8dda692df0da2

Same key, same plaintext, two different ciphertexts.