Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I haven't lost my mind -- it's backed up on tape somewhere.


devel / sci.crypt / Re: Flexible-size block ciphers with unbalanced Feistel networks

SubjectAuthor
* Flexible-size block ciphers with unbalanced Feistel networksLeo
+* Re: Flexible-size block ciphers with unbalanced Feistel networksChris M. Thomasson
|+* Re: Flexible-size block ciphers with unbalanced Feistel networksChris M. Thomasson
||`* Re: Flexible-size block ciphers with unbalanced Feistel networksLeo
|| `* Re: Flexible-size block ciphers with unbalanced Feistel networksChris M. Thomasson
||  `* Re: Flexible-size block ciphers with unbalanced Feistel networksChris M. Thomasson
||   `- Re: Flexible-size block ciphers with unbalanced Feistel networksChris M. Thomasson
|`* Re: Flexible-size block ciphers with unbalanced Feistel networksRichard Harnden
| `- Re: Flexible-size block ciphers with unbalanced Feistel networksChris M. Thomasson
`- Re: Flexible-size block ciphers with unbalanced Feistel networksLeo

1
Flexible-size block ciphers with unbalanced Feistel networks

<uph45u$2819f$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=749&group=sci.crypt#749

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: test@example.com (Leo)
Newsgroups: sci.crypt
Subject: Flexible-size block ciphers with unbalanced Feistel networks
Date: Thu, 1 Feb 2024 21:58:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <uph45u$2819f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 21:58:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c228d631748a711bb26db1f25d22525a";
logging-data="2360623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dp34+Lt2MYv4kclGfA+T+"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:2DxxLTqkMri4umZgYWUK1PEtyCo=
 by: Leo - Thu, 1 Feb 2024 21:58 UTC

Hey sci.crypt,

I wanted an encrypted and authenticated "secret box" like thing. Instead
of the usual IV + encrypted blob + MAC combination, I wanted to explore
the problem space and have a little fun.

I used an unbalanced Feistel network, with one part being a single byte.
For this, I needed a round function that can take the rest of the block
along with a key, and reduce it into a single byte. I go through the
entire block and perform N rounds of Feistel for an N-byte block.

A standard Merkle-Damgard hash works well for this, but there are a ton of
options that can work for this purpose. Perhaps something to explore in
the future.

"Regular" solutions are really malleable. Depending on the block cipher
mode, it is quite easy to modify the ciphertext to affect the plaintext in
predictable ways. This goes from flipping bits while only breaking a
single block all the way to being able to make arbitrary modifications as
long as you know the plaintext. This causes MACs to have a massive
importance.

With this mode, any change to the ciphertext affects the entire plaintext
in a random way. It sort of An ASCII message ceases to be meaningful text,
a JSON message ceases to be valid JSON etc. Depending on the security
target, a MAC can be completely left out. Or a fixed string somewhere can
be used in place of a MAC, like every valid block starting/ending with
0xCAFEBABE to have the same effect as a 32-bit MAC.

Have any of you used a similar construction anywhere? I'd be curious to
know what you think, I had a lot of fun playing around with this, and it
even ended up having some convenient properties.

I'm putting a small example in Python with SHA-256 as the round function.

import hashlib

def sha256(x: bytes) -> int: return hashlib.sha256(x).digest()[0]

def encrypt(buf: bytes, key: bytes) -> bytes:
key = len(key).to_bytes(8, 'little') + key

for _ in range(len(buf)):
left, right = buf[0], buf[1:]
new_right = sha256(key + right) ^ left
buf = right + bytes([new_right])

return buf

def decrypt(buf: bytes, key: bytes) -> bytes:
key = len(key).to_bytes(8, 'little') + key

for _ in range(len(buf)):
left, right = buf[:-1], buf[-1]
new_left = sha256(key + left) ^ right
buf = bytes([new_left]) + left

return buf

while True:
action = input("'encrypt' or 'decrypt'? ")
if action not in ('encrypt', 'decrypt'): continue
key = input("key: ").encode("utf-8")
buf = input("data: ")

if action == 'encrypt':
buf = buf.encode("utf-8")
print(encrypt(buf, key).hex())
elif action == 'decrypt':
buf = bytes.fromhex(buf)
print(decrypt(buf, key))

--
Leo

Re: Flexible-size block ciphers with unbalanced Feistel networks

<uph4kf$28b21$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=750&group=sci.crypt#750

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Thu, 1 Feb 2024 14:06:07 -0800
Organization: A noiseless patient Spider
Lines: 100
Message-ID: <uph4kf$28b21$1@dont-email.me>
References: <uph45u$2819f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 22:06:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5db24bf58349e0f24b4ca76196085dd";
logging-data="2370625"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/u2TRax0/IwH+SWT9Po2mLuBWfNEGUVq8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:flBZUG2VxNAEaT5Gf5tlAC4S/wI=
Content-Language: en-US
In-Reply-To: <uph45u$2819f$1@dont-email.me>
 by: Chris M. Thomasson - Thu, 1 Feb 2024 22:06 UTC

On 2/1/2024 1:58 PM, Leo wrote:
> Hey sci.crypt,
>
> I wanted an encrypted and authenticated "secret box" like thing. Instead
> of the usual IV + encrypted blob + MAC combination, I wanted to explore
> the problem space and have a little fun.
>
> I used an unbalanced Feistel network, with one part being a single byte.
> For this, I needed a round function that can take the rest of the block
> along with a key, and reduce it into a single byte. I go through the
> entire block and perform N rounds of Feistel for an N-byte block.
>
> A standard Merkle-Damgard hash works well for this, but there are a ton of
> options that can work for this purpose. Perhaps something to explore in
> the future.
>
> "Regular" solutions are really malleable. Depending on the block cipher
> mode, it is quite easy to modify the ciphertext to affect the plaintext in
> predictable ways. This goes from flipping bits while only breaking a
> single block all the way to being able to make arbitrary modifications as
> long as you know the plaintext. This causes MACs to have a massive
> importance.
>
> With this mode, any change to the ciphertext affects the entire plaintext
> in a random way. It sort of An ASCII message ceases to be meaningful text,
> a JSON message ceases to be valid JSON etc. Depending on the security
> target, a MAC can be completely left out. Or a fixed string somewhere can
> be used in place of a MAC, like every valid block starting/ending with
> 0xCAFEBABE to have the same effect as a 32-bit MAC.
>
> Have any of you used a similar construction anywhere? I'd be curious to
> know what you think, I had a lot of fun playing around with this, and it
> even ended up having some convenient properties.

Nice! I need to study this some more for sure. Thanks Leo! :^)

Fwiw, I am kind of busy right now... Basically, it kind of reminds me of
one of my experimental HMAC ciphers. Altering a single byte of the
ciphertext causes a radically different plaintext to be generated,
random? Humm... A radically different ciphertext is generated on every
encryption of the exact same cipher text:

http://funwithfractals.atspace.cc/ct_cipher/

Fwiw, here in an online example using the default key to encrypt.

http://fractallife247.com/test/hmac_cipher/ver_0_0_0_1?ct_hmac_cipher=6eb6ffcc4ecce8d2f154fd52fb847accc4904df790294012eea5570f619d65a3a2cc0e682a0298274a692955fbd3d77ed0fd15812e0afbc1c8f5e5d47a8ebc7026ad512165ad6207961f1c5eb731e704

The online version has an option of sha-256 and sha-512 in the secret
key. You should be able to click on the link, and see the decrypted
message since it uses the default key. Fwiw, as of now, it does not use
a final MAC...

It sure seems to be fairly, "secure"... Although it has not been
properly peer reviewed yet. So, experimental is shall remain... ;^)

>
> I'm putting a small example in Python with SHA-256 as the round function.
>
> import hashlib
>
> def sha256(x: bytes) -> int: return hashlib.sha256(x).digest()[0]
>
> def encrypt(buf: bytes, key: bytes) -> bytes:
> key = len(key).to_bytes(8, 'little') + key
>
> for _ in range(len(buf)):
> left, right = buf[0], buf[1:]
> new_right = sha256(key + right) ^ left
> buf = right + bytes([new_right])
>
> return buf
>
> def decrypt(buf: bytes, key: bytes) -> bytes:
> key = len(key).to_bytes(8, 'little') + key
>
> for _ in range(len(buf)):
> left, right = buf[:-1], buf[-1]
> new_left = sha256(key + left) ^ right
> buf = bytes([new_left]) + left
>
> return buf
>
> while True:
> action = input("'encrypt' or 'decrypt'? ")
> if action not in ('encrypt', 'decrypt'): continue
> key = input("key: ").encode("utf-8")
> buf = input("data: ")
>
> if action == 'encrypt':
> buf = buf.encode("utf-8")
> print(encrypt(buf, key).hex())
> elif action == 'decrypt':
> buf = bytes.fromhex(buf)
> print(decrypt(buf, key))
>
>

Re: Flexible-size block ciphers with unbalanced Feistel networks

<uph4t8$28b21$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=751&group=sci.crypt#751

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Thu, 1 Feb 2024 14:10:48 -0800
Organization: A noiseless patient Spider
Lines: 111
Message-ID: <uph4t8$28b21$2@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 22:10:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5db24bf58349e0f24b4ca76196085dd";
logging-data="2370625"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0nHW70WQ0BOnnJO+Y88GLqoPi0DNobz8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:CwsLhH+kCXJ77paTiEFm0G0lH1s=
In-Reply-To: <uph4kf$28b21$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Thu, 1 Feb 2024 22:10 UTC

On 2/1/2024 2:06 PM, Chris M. Thomasson wrote:
> On 2/1/2024 1:58 PM, Leo wrote:
>> Hey sci.crypt,
>>
>> I wanted an encrypted and authenticated "secret box" like thing. Instead
>> of the usual IV + encrypted blob + MAC combination, I wanted to explore
>> the problem space and have a little fun.
>>
>> I used an unbalanced Feistel network, with one part being a single byte.
>> For this, I needed a round function that can take the rest of the block
>> along with a key, and reduce it into a single byte. I go through the
>> entire block and perform N rounds of Feistel for an N-byte block.
>>
>> A standard Merkle-Damgard hash works well for this, but there are a
>> ton of
>> options that can work for this purpose. Perhaps something to explore in
>> the future.
>>
>> "Regular" solutions are really malleable. Depending on the block cipher
>> mode, it is quite easy to modify the ciphertext to affect the
>> plaintext in
>> predictable ways. This goes from flipping bits while only breaking a
>> single block all the way to being able to make arbitrary modifications as
>> long as you know the plaintext. This causes MACs to have a massive
>> importance.
>>
>> With this mode, any change to the ciphertext affects the entire plaintext
>> in a random way. It sort of An ASCII message ceases to be meaningful
>> text,
>> a JSON message ceases to be valid JSON etc. Depending on the security
>> target, a MAC can be completely left out. Or a fixed string somewhere can
>> be used in place of a MAC, like every valid block starting/ending with
>> 0xCAFEBABE to have the same effect as a 32-bit MAC.
>>
>> Have any of you used a similar construction anywhere? I'd be curious to
>> know what you think, I had a lot of fun playing around with this, and it
>> even ended up having some convenient properties.
>
> Nice! I need to study this some more for sure. Thanks Leo! :^)
>
> Fwiw, I am kind of busy right now... Basically, it kind of reminds me of
> one of my experimental HMAC ciphers. Altering a single byte of the
> ciphertext causes a radically different plaintext to be generated,
> random? Humm... A radically different ciphertext is generated on every
> encryption of the exact same cipher text:
>
> http://funwithfractals.atspace.cc/ct_cipher/
>
> Fwiw, here in an online example using the default key to encrypt.
>
> http://fractallife247.com/test/hmac_cipher/ver_0_0_0_1?ct_hmac_cipher=6eb6ffcc4ecce8d2f154fd52fb847accc4904df790294012eea5570f619d65a3a2cc0e682a0298274a692955fbd3d77ed0fd15812e0afbc1c8f5e5d47a8ebc7026ad512165ad6207961f1c5eb731e704
>
> The online version has an option of sha-256 and sha-512 in the secret
> key. You should be able to click on the link, and see the decrypted
> message since it uses the default key. Fwiw, as of now, it does not use
> a final MAC...
>
> It sure seems to be fairly, "secure"... Although it has not been
> properly peer reviewed yet. So, experimental is shall remain... ;^)

Also, try altering a single bit of the password and/or ciphertext, or
changing the hash function, then clicking decrypt. The plaintext will be
radically different.

>
>
>
>>
>> I'm putting a small example in Python with SHA-256 as the round function.
>>
>> import hashlib
>>
>> def sha256(x: bytes) -> int: return hashlib.sha256(x).digest()[0]
>>
>> def encrypt(buf: bytes, key: bytes) -> bytes:
>>      key = len(key).to_bytes(8, 'little') + key
>>
>>      for _ in range(len(buf)):
>>          left, right = buf[0], buf[1:]
>>          new_right = sha256(key + right) ^ left
>>          buf = right + bytes([new_right])
>>
>>      return buf
>>
>> def decrypt(buf: bytes, key: bytes) -> bytes:
>>      key = len(key).to_bytes(8, 'little') + key
>>
>>      for _ in range(len(buf)):
>>          left, right = buf[:-1], buf[-1]
>>          new_left = sha256(key + left) ^ right
>>          buf = bytes([new_left]) + left
>>
>>      return buf
>>
>> while True:
>>      action = input("'encrypt' or 'decrypt'? ")
>>      if action not in ('encrypt', 'decrypt'): continue
>>      key = input("key: ").encode("utf-8")
>>      buf = input("data: ")
>>
>>      if action == 'encrypt':
>>          buf = buf.encode("utf-8")
>>          print(encrypt(buf, key).hex())
>>      elif action == 'decrypt':
>>          buf = bytes.fromhex(buf)
>>          print(decrypt(buf, key))
>>
>>
>

Re: Flexible-size block ciphers with unbalanced Feistel networks

<uph75i$2819f$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=752&group=sci.crypt#752

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: test@example.com (Leo)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Thu, 1 Feb 2024 22:49:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <uph75i$2819f$2@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
<uph4t8$28b21$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 22:49:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c228d631748a711bb26db1f25d22525a";
logging-data="2360623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1VpvGt8K6L1xu0WLZmPnm"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:pe8qGhCecNira6sJYyZOy6KgQwA=
 by: Leo - Thu, 1 Feb 2024 22:49 UTC

On Thu, 1 Feb 2024 14:10:48 -0800, Chris M. Thomasson wrote:

>> Nice! I need to study this some more for sure. Thanks Leo! :^)
>>
>> Fwiw, I am kind of busy right now... Basically, it kind of reminds me
>> of one of my experimental HMAC ciphers. Altering a single byte of the
>> ciphertext causes a radically different plaintext to be generated,
>> random? Humm... A radically different ciphertext is generated on every
>> encryption of the exact same cipher text:
>>
>> http://funwithfractals.atspace.cc/ct_cipher/
>>
>> Fwiw, here in an online example using the default key to encrypt.

HMAC would fit into this cipher very naturally too. Instead of sha256(key
+ data), you'd do hmacsha256(key, data).

>> The online version has an option of sha-256 and sha-512 in the secret
>> key. You should be able to click on the link, and see the decrypted
>> message since it uses the default key.

>> Fwiw, as of now, it does not use a final MAC...

I am wondering if a proper MAC is even with these kinds of constructions.
Have you run any tests on how many random bit flips / modifications you
need in order to have something that is all ASCII? I think especially with
things with humans in the loop (like messaging or emails), it will be very
obvious if someone is tampering with the message.

>> It sure seems to be fairly, "secure"... Although it has not been
>> properly peer reviewed yet. So, experimental is shall remain... ;^)

It's possible to mess up, of course, but using HMAC-SHA256 is a very safe
bet. You can be pretty much 100% sure that any vulnerabilities or problems
will arise from your own code or protocol instead of the core primitive.
This is very useful, much less code to comb over and usually much simpler
code too.

And especially HMACs are very forgiving, pretty hard to misuse those.

When someone posts on sci.crypt with a completely custom construction it's
more likely to be broken by someone here. Can't say the same about people
re-using SHA-256.

> Also, try altering a single bit of the password and/or ciphertext, or
> changing the hash function, then clicking decrypt. The plaintext will be
> radically different.

Yep, this is what made me want the entire message in one "block" too.
Block ciphers have excellent avalanche/garbling with unintended
modifications, but it's usually only for a single block. So if you have
your entire message and nonce/IV in a single block, everything has this
useful property.

--
Leo

Re: Flexible-size block ciphers with unbalanced Feistel networks

<uph78d$2819f$3@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=753&group=sci.crypt#753

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: test@example.com (Leo)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Thu, 1 Feb 2024 22:50:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <uph78d$2819f$3@dont-email.me>
References: <uph45u$2819f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 22:50:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c228d631748a711bb26db1f25d22525a";
logging-data="2360623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dPH1soflfIZ9nq3i9X4TT"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:pgpt7WfbRYVmShfAVeg0/O1R/1Y=
 by: Leo - Thu, 1 Feb 2024 22:50 UTC

On Thu, 1 Feb 2024 21:58:23 -0000 (UTC), Leo wrote:

> "Regular" solutions are really malleable. Depending on the block cipher
> mode, it is quite easy to modify the ciphertext to affect the plaintext
> in predictable ways. This goes from flipping bits while only breaking a
> single block all the way to being able to make arbitrary modifications
> as long as you know the plaintext. This causes MACs to have a massive
> importance.
>
> With this mode, any change to the ciphertext affects the entire
> plaintext in a random way. It sort of

Oops, looks like I forgot to finish my sentence there.

I mean to say, "It sort of behaves like an All-or-nothing transform".

--
Leo

Re: Flexible-size block ciphers with unbalanced Feistel networks

<upj60u$2m5jv$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=754&group=sci.crypt#754

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard.nospam@gmail.invalid (Richard Harnden)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Fri, 2 Feb 2024 16:42:06 +0000
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <upj60u$2m5jv$1@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
Reply-To: nospam.harnden@invalid.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 2 Feb 2024 16:42:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="096f3fb45299463c783afc9c5cd31db5";
logging-data="2823807"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZU6k1it/yTiGMzX25binadJv6vjjSG8g="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mI8Qz1Yrhvj69hdBpoJiw//XEdw=
In-Reply-To: <uph4kf$28b21$1@dont-email.me>
Content-Language: en-GB
 by: Richard Harnden - Fri, 2 Feb 2024 16:42 UTC

On 01/02/2024 22:06, Chris M. Thomasson wrote:
> On 2/1/2024 1:58 PM, Leo wrote:
>> Hey sci.crypt,
>>
>> I wanted an encrypted and authenticated "secret box" like thing. Instead
>> of the usual IV + encrypted blob + MAC combination, I wanted to explore
>> the problem space and have a little fun.
>
> Fwiw, [...]

Chris: please stop trying to turn every thread into 'look at my highly
experimental hmac cipher wotsit'

Re: Flexible-size block ciphers with unbalanced Feistel networks

<upk0hq$2qk1q$1@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=755&group=sci.crypt#755

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Fri, 2 Feb 2024 16:14:50 -0800
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <upk0hq$2qk1q$1@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
<upj60u$2m5jv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 3 Feb 2024 00:14:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="701cdbc117df9d402df8754b470a5d48";
logging-data="2969658"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nlzvICT0szMEoWXenhDNEJEUDaaZezOg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jrpYqFHI4stoLb5fM6Yl2QVFI5A=
Content-Language: en-US
In-Reply-To: <upj60u$2m5jv$1@dont-email.me>
 by: Chris M. Thomasson - Sat, 3 Feb 2024 00:14 UTC

On 2/2/2024 8:42 AM, Richard Harnden wrote:
> On 01/02/2024 22:06, Chris M. Thomasson wrote:
>> On 2/1/2024 1:58 PM, Leo wrote:
>>> Hey sci.crypt,
>>>
>>> I wanted an encrypted and authenticated "secret box" like thing. Instead
>>> of the usual IV + encrypted blob + MAC combination, I wanted to explore
>>> the problem space and have a little fun.
>>
>> Fwiw, [...]
>
> Chris:  please stop trying to turn every thread into 'look at my highly
> experimental hmac cipher wotsit'
>
>

Not meant as a hijack at all. My apologies to Leo. Do you have any
constructive comments, or examples of other ciphers that might be similar?

Re: Flexible-size block ciphers with unbalanced Feistel networks

<upsjfb$nn8a$3@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=759&group=sci.crypt#759

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Mon, 5 Feb 2024 22:26:51 -0800
Organization: A noiseless patient Spider
Lines: 84
Message-ID: <upsjfb$nn8a$3@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
<uph4t8$28b21$2@dont-email.me> <uph75i$2819f$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Feb 2024 06:26:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d977dfc718b87c6477e28e021d409c7a";
logging-data="777482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XYYe6Pky+a/22Ew/ACulF+2vrsgfLc0M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:yldM+gBLbt9XggG3odw/eAwNSQY=
In-Reply-To: <uph75i$2819f$2@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 6 Feb 2024 06:26 UTC

On 2/1/2024 2:49 PM, Leo wrote:
> On Thu, 1 Feb 2024 14:10:48 -0800, Chris M. Thomasson wrote:
>
>>> Nice! I need to study this some more for sure. Thanks Leo! :^)
>>>
>>> Fwiw, I am kind of busy right now... Basically, it kind of reminds me
>>> of one of my experimental HMAC ciphers. Altering a single byte of the
>>> ciphertext causes a radically different plaintext to be generated,
>>> random? Humm... A radically different ciphertext is generated on every
>>> encryption of the exact same cipher text:
>>>
>>> http://funwithfractals.atspace.cc/ct_cipher/
>>>
>>> Fwiw, here in an online example using the default key to encrypt.
>
> HMAC would fit into this cipher very naturally too. Instead of sha256(key
> + data), you'd do hmacsha256(key, data).
>
>>> The online version has an option of sha-256 and sha-512 in the secret
>>> key. You should be able to click on the link, and see the decrypted
>>> message since it uses the default key.
>
>>> Fwiw, as of now, it does not use a final MAC...
>
> I am wondering if a proper MAC is even with these kinds of constructions.

Interesting because the plaintext is basically "randomized" if a single
bit of the ciphertext and/or password is altered. Since I think adding
what HMAC and HASH to use should be in the secret key itself, well, that
is a factor... ;^)

> Have you run any tests on how many random bit flips / modifications you
> need in order to have something that is all ASCII?

No. Well, I don't think so. You mean trying to flips bits until the
generated plaintext wrt decrypting is all ASCII? Or do you mean
something else I am missing? Thanks Leo.

> I think especially with
> things with humans in the loop (like messaging or emails), it will be very
> obvious if someone is tampering with the message.

Humm... I need to create a new thread to test drive this. Btw, I did not
mean to hijack your thread with my work. I am glad that you are
experimenting around with these types of cipher schemes. Thanks!

>
>>> It sure seems to be fairly, "secure"... Although it has not been
>>> properly peer reviewed yet. So, experimental is shall remain... ;^)
>
> It's possible to mess up, of course, but using HMAC-SHA256 is a very safe
> bet.

I second that. It seems to be okay to "abuse" HMAC like this. Humm. Not
100% sure on that. But, it sure "seems" to be okay.

> You can be pretty much 100% sure that any vulnerabilities or problems
> will arise from your own code or protocol instead of the core primitive.
> This is very useful, much less code to comb over and usually much simpler
> code too.
>
> And especially HMACs are very forgiving, pretty hard to misuse those.
>
> When someone posts on sci.crypt with a completely custom construction it's
> more likely to be broken by someone here. Can't say the same about people
> re-using SHA-256.
>
>> Also, try altering a single bit of the password and/or ciphertext, or
>> changing the hash function, then clicking decrypt. The plaintext will be
>> radically different.
>
> Yep, this is what made me want the entire message in one "block" too.
> Block ciphers have excellent avalanche/garbling with unintended
> modifications, but it's usually only for a single block. So if you have
> your entire message and nonce/IV in a single block, everything has this
> useful property.
>

I just use enough digests, or blocks if you will to cover any sized
plaintext.

Re: Flexible-size block ciphers with unbalanced Feistel networks

<upsjno$nn8a$4@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=760&group=sci.crypt#760

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Mon, 5 Feb 2024 22:31:20 -0800
Organization: A noiseless patient Spider
Lines: 94
Message-ID: <upsjno$nn8a$4@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
<uph4t8$28b21$2@dont-email.me> <uph75i$2819f$2@dont-email.me>
<upsjfb$nn8a$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Feb 2024 06:31:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d977dfc718b87c6477e28e021d409c7a";
logging-data="777482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Y0uzWEZP4VKBp4x9FMGahw7H4msXlR/U="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/1VD7l5qu1szCVbf3+SVl7doKO0=
In-Reply-To: <upsjfb$nn8a$3@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 6 Feb 2024 06:31 UTC

On 2/5/2024 10:26 PM, Chris M. Thomasson wrote:
> On 2/1/2024 2:49 PM, Leo wrote:
>> On Thu, 1 Feb 2024 14:10:48 -0800, Chris M. Thomasson wrote:
>>
>>>> Nice! I need to study this some more for sure. Thanks Leo! :^)
>>>>
>>>> Fwiw, I am kind of busy right now... Basically, it kind of reminds me
>>>> of one of my experimental HMAC ciphers. Altering a single byte of the
>>>> ciphertext causes a radically different plaintext to be generated,
>>>> random? Humm... A radically different ciphertext is generated on every
>>>> encryption of the exact same cipher text:
>>>>
>>>> http://funwithfractals.atspace.cc/ct_cipher/
>>>>
>>>> Fwiw, here in an online example using the default key to encrypt.
>>
>> HMAC would fit into this cipher very naturally too. Instead of sha256(key
>> + data), you'd do hmacsha256(key, data).
>>
>>>> The online version has an option of sha-256 and sha-512 in the secret
>>>> key. You should be able to click on the link, and see the decrypted
>>>> message since it uses the default key.
>>
>>>> Fwiw, as of now, it does not use a final MAC...
>>
>> I am wondering if a proper MAC is even with these kinds of constructions.
>
> Interesting because the plaintext is basically "randomized" if a single
> bit of the ciphertext and/or password is altered. Since I think adding
> what HMAC and HASH to use should be in the secret key itself, well, that
> is a factor... ;^)
>
>
>> Have you run any tests on how many random bit flips / modifications you
>> need in order to have something that is all ASCII?
>
> No. Well, I don't think so. You mean trying to flips bits until the
> generated plaintext wrt decrypting is all ASCII? Or do you mean
> something else I am missing? Thanks Leo.
>
>
>> I think especially with
>> things with humans in the loop (like messaging or emails), it will be
>> very
>> obvious if someone is tampering with the message.
>
> Humm... I need to create a new thread to test drive this. Btw, I did not
> mean to hijack your thread with my work. I am glad that you are
> experimenting around with these types of cipher schemes. Thanks!
>
>
>>
>>>> It sure seems to be fairly, "secure"... Although it has not been
>>>> properly peer reviewed yet. So, experimental is shall remain... ;^)
>>
>> It's possible to mess up, of course, but using HMAC-SHA256 is a very safe
>> bet.
>
> I second that. It seems to be okay to "abuse" HMAC like this. Humm. Not
> 100% sure on that. But, it sure "seems" to be okay.
>
>
>> You can be pretty much 100% sure that any vulnerabilities or problems
>> will arise from your own code or protocol instead of the core primitive.
>> This is very useful, much less code to comb over and usually much simpler
>> code too.
>>
>> And especially HMACs are very forgiving, pretty hard to misuse those.
>>
>> When someone posts on sci.crypt with a completely custom construction
>> it's
>> more likely to be broken by someone here. Can't say the same about people
>> re-using SHA-256.
>>
>>> Also, try altering a single bit of the password and/or ciphertext, or
>>> changing the hash function, then clicking decrypt. The plaintext will be
>>> radically different.
>>
>> Yep, this is what made me want the entire message in one "block" too.
>> Block ciphers have excellent avalanche/garbling with unintended
>> modifications, but it's usually only for a single block. So if you have
>> your entire message and nonce/IV in a single block, everything has this
>> useful property.
>>
>
> I just use enough digests, or blocks if you will to cover any sized
> plaintext.

Also, when you get some free time to burn, try to put your idea up on
the web, where you contain ciphertext in the actual URL. Something like
this:

http://fractallife247.com/test/hmac_cipher/ver_0_0_0_1?ct_hmac_cipher=b1dbe69aa10a7a54cd16237798ff7ed5e08e31dcf469f7c578be0127a1c26b1188adea1441b87715e60b7af394b7ec8689dc0a5d1c03f7b1709e32f62c9d392d605904be5524b71560e0a374b1f2b0578d3f3883859e5b2121891c325c35742386bf96d909224586e995c95c416ca1be0470bc758d3d24b4027ba46efc264518ba7af276998b11be735d9b4525f95180ddcd7a78e2b5bee371529842921211e959192aa3ed6ca05a6564fafe12803d4caa95ad6b8ad0268905c930532550aad5874b1056ae52e078631c0638a3140d44bdcc99f92cc899df29212be4229c13c22972c4172751453d286b4f1d07b5cf46d2

Re: Flexible-size block ciphers with unbalanced Feistel networks

<upsr7h$q63b$2@dont-email.me>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=761&group=sci.crypt#761

  copy link   Newsgroups: sci.crypt
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: sci.crypt
Subject: Re: Flexible-size block ciphers with unbalanced Feistel networks
Date: Tue, 6 Feb 2024 00:39:14 -0800
Organization: A noiseless patient Spider
Lines: 99
Message-ID: <upsr7h$q63b$2@dont-email.me>
References: <uph45u$2819f$1@dont-email.me> <uph4kf$28b21$1@dont-email.me>
<uph4t8$28b21$2@dont-email.me> <uph75i$2819f$2@dont-email.me>
<upsjfb$nn8a$3@dont-email.me> <upsjno$nn8a$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Feb 2024 08:39:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d977dfc718b87c6477e28e021d409c7a";
logging-data="858219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1986Ky0fJW1UUSei+J0ivf3MiQXLWMJ9mo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:xTM+lAXjJElWxCvbBv2aU8J+Hu4=
In-Reply-To: <upsjno$nn8a$4@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 6 Feb 2024 08:39 UTC

On 2/5/2024 10:31 PM, Chris M. Thomasson wrote:
> On 2/5/2024 10:26 PM, Chris M. Thomasson wrote:
>> On 2/1/2024 2:49 PM, Leo wrote:
>>> On Thu, 1 Feb 2024 14:10:48 -0800, Chris M. Thomasson wrote:
>>>
>>>>> Nice! I need to study this some more for sure. Thanks Leo! :^)
>>>>>
>>>>> Fwiw, I am kind of busy right now... Basically, it kind of reminds me
>>>>> of one of my experimental HMAC ciphers. Altering a single byte of the
>>>>> ciphertext causes a radically different plaintext to be generated,
>>>>> random? Humm... A radically different ciphertext is generated on every
>>>>> encryption of the exact same cipher text:
>>>>>
>>>>> http://funwithfractals.atspace.cc/ct_cipher/
>>>>>
>>>>> Fwiw, here in an online example using the default key to encrypt.
>>>
>>> HMAC would fit into this cipher very naturally too. Instead of
>>> sha256(key
>>> + data), you'd do hmacsha256(key, data).
>>>
>>>>> The online version has an option of sha-256 and sha-512 in the secret
>>>>> key. You should be able to click on the link, and see the decrypted
>>>>> message since it uses the default key.
>>>
>>>>> Fwiw, as of now, it does not use a final MAC...
>>>
>>> I am wondering if a proper MAC is even with these kinds of
>>> constructions.
>>
>> Interesting because the plaintext is basically "randomized" if a
>> single bit of the ciphertext and/or password is altered. Since I think
>> adding what HMAC and HASH to use should be in the secret key itself,
>> well, that is a factor... ;^)
>>
>>
>>> Have you run any tests on how many random bit flips / modifications you
>>> need in order to have something that is all ASCII?
>>
>> No. Well, I don't think so. You mean trying to flips bits until the
>> generated plaintext wrt decrypting is all ASCII? Or do you mean
>> something else I am missing? Thanks Leo.
>>
>>
>>> I think especially with
>>> things with humans in the loop (like messaging or emails), it will be
>>> very
>>> obvious if someone is tampering with the message.
>>
>> Humm... I need to create a new thread to test drive this. Btw, I did
>> not mean to hijack your thread with my work. I am glad that you are
>> experimenting around with these types of cipher schemes. Thanks!
>>
>>
>>>
>>>>> It sure seems to be fairly, "secure"... Although it has not been
>>>>> properly peer reviewed yet. So, experimental is shall remain... ;^)
>>>
>>> It's possible to mess up, of course, but using HMAC-SHA256 is a very
>>> safe
>>> bet.
>>
>> I second that. It seems to be okay to "abuse" HMAC like this. Humm.
>> Not 100% sure on that. But, it sure "seems" to be okay.
>>
>>
>>> You can be pretty much 100% sure that any vulnerabilities or problems
>>> will arise from your own code or protocol instead of the core primitive.
>>> This is very useful, much less code to comb over and usually much
>>> simpler
>>> code too.
>>>
>>> And especially HMACs are very forgiving, pretty hard to misuse those.
>>>
>>> When someone posts on sci.crypt with a completely custom construction
>>> it's
>>> more likely to be broken by someone here. Can't say the same about
>>> people
>>> re-using SHA-256.
>>>
>>>> Also, try altering a single bit of the password and/or ciphertext, or
>>>> changing the hash function, then clicking decrypt. The plaintext
>>>> will be
>>>> radically different.
>>>
>>> Yep, this is what made me want the entire message in one "block" too.
>>> Block ciphers have excellent avalanche/garbling with unintended
>>> modifications, but it's usually only for a single block. So if you have
>>> your entire message and nonce/IV in a single block, everything has this
>>> useful property.
[...]

Fwiw, also, wrt the way I am using HMAC, well, I am feeding it plaintext
as well. So this makes it kind of like MAC'ing a completed ciphertext.
Humm... The ciphertext/plaintext sensitivity is pretty damn good in
these types of ciphers Leo. You already know that, but its interesting
to me. Prepending TRNG numbers to the plaintext larger than a digest is
very important. These random numbers get fed in the HMAC chain, if you
will...


devel / sci.crypt / Re: Flexible-size block ciphers with unbalanced Feistel networks

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor