« first day (2078 days earlier)      last day (2593 days later) » 

2:30 AM
@EllaRose - I am unclear on the different design you are thinking of. Could you explain further? "4 x 32 bit" doesn't quite make sense to me in the context of MDS matrices and active byte-sized s-boxes.
 
sure. Basically, my state consists of 4 fours
each of which is 32 bits long
I have a 4x4 s-box that is applied on each 4 bit tall, 1 bit wide column
(32 times in parallel)
my linear column mixing function mixes each 4 bit tall, 1 bit wide column
then, each of the second, third, and fourth rows are shifted by varying amounts
I apologize for the linked implementation; It is actually computing 4 of those states at once, so is probably not a good reference
hrmm, that first sentence was supposed to say "...state consists of 4 words"
so I don't have byte sized s-boxes
I don't know if MDS matrices are applicable/at use in my design (I'm not such a math buff, I only sort of know what an MDS matrix is)
but basically, in my design, worst case scenario requires 2 applications of the linear mixing layer to cause full diffusion
and I was wondering if it was advantageous to apply the non-linear s-box layer every full diffusion, instead of every half diffusion
 
Wait, are you saying the linear mixing function mixes the same four bits as those that are passed through the 4 x 4 s-box?
 
sub bytes -> mix columns -> shift rows -> mix columns -> shift rows -> mix columns -> shift rows

that is one round in my design
(it takes that many shifts to propagate changes to the left of the words)
so the experiment is to do instead:

sub bytes -> mix columns -> shift rows -> mix columns -> shift rows -> mix columns -> shift rows -> mix columns -> shift rows -> mix columns -> shift rows -> mix columns -> shift rows

Instead of putting another sub bytes in the middle there
if that makes any sense at all?
I appreciate your time immensely, by the way
 
To clarify, let's number each bit with 0 to 127, so first row/word is 0, 1, 2, ...31, second row is bits 32 to 63, third row is 64 to 95, then fourth row is bits 96 to 127. Which bits go into a single instance of the s-box? Is it like Serpent - i.e. bits 0, 32, 64 and 96 go together into a single s-box? If so, then which bits go into the mixcolumns function? The same four bits?
 
yes, that appears to be accurate
mix columns and the s-box both operate on 4-bit tall, 1-bit wide columns
and they do so in parallel, because it's bitsliced (like Serpent)
 
2:48 AM
Well, first off you don't need that first mix columns, because the s-box mixes those four bits together better than a linear function could hope to do. Second, the concept of MDS doesn't really apply to a 4 x 4 bit matrix. There is a related bitwise concept, and it is possible to have matrices with minimum lower bounds on the number of active bits.
But it's sort of a different animal than the bytewise approach used in AES. There's a cipher that uses a linear matrix based on the bitwise branch number, but for the life of me I can't remember what it is called . . .
 
ahh, hrmm I have that variant already actually
one that foregoes the linear column mixer and just utilizes the sub bytes one to do the job
It kind of trips me up that it applies the substitution and branching in the same step though
 
Well, to be clear I was saying just that 1st mix columns step is not necessary. I wasn't saying anything about not needing the other mix columns steps that you describe . .
 
basically, the other design renames sub bytes to mix columns
and just throws out the linear mix columns operation entirely
is that bad?
sorry, I guess we're getting into more questions then you bargained for here
I could go on forever, don't mind me
 
By the way, if you are having difficulties with the concept of MDS matrices, I can recommend a paper: On the Need for Multipermutations, by Vaudenay (citeseerx.ist.psu.edu/viewdoc/…) It's an older paper that basically introduced the idea of using MDS matrices for crypto (though it uses the somewhat clearer term "multipermutation" instead of MDS).
 
thank you! :)
 
2:55 AM
Reading that paper made MDS so much clearer to me. Maybe it will for you too.
I think that's the paper. Sometimes it's hard to remember which paper was the one that clarified things . . .
Anyway, you can't have a bitwise multipermutation because there is just one bitwise permutation (the identity function), and a square matrix with every bit set to one (which is necessary for every single bit 'submatrix' to be a permutation) is not a permutation. Hopefully this will be clearer once you have read the paper . . .
 
hrmm, what do you mean by bitwise permutation? or should I just continue reading
if being multipermutation implies perfect diffusion, does that mean we can't have bitwise functions with perfect diffusion? That sounds like I am interpreting something wrong
 
i.e. if you have a single bit, how many permutations can you apply to it. I actually mispoke - there are two possible permutations - the identity function and the complementation function. i.e. 0,1 becomes 0,1 (identity) and 0,1 becomes 1,0 (the bit is complemented).
 
ahhhh
now that makes sense
 
No, the paper is talking about perfect diffusion in the sense that every byte is a function of every other byte. Not every bit is a function of every other bit.
 
oh I see
 
3:09 AM
Anyway, I am getting tired. Give the paper a read and if you have questions about MDS matrices you can ask them in the main stackexchange. But I wouldn't feel too bad about having difficulties lower bounding the number of active s-boxes in bitslices Serpent-like designs - that is a nontrivial problem.
 
alrighty, thank you for everything. I hope you have pleasant dreams!
 
Night.
 
 
5 hours later…
8:16 AM
@Evinda That algorithm looks correct! Note that div_rem(n,2) = n >> 1. So that is actually really cheap. I think you have to be careful with your big-$O$ notation. A multiplication is a single group operation, so it is $O(1)$ if we measure the complexity as the number of group operations. If we measure it with respect to a different metric, it could have different big-$O$ complexity.
Also, I'm not claiming this is the most efficient way to do your computation. I'm saying this way it's easy to directly count the number of group operations you need, since the repeated-squaring algorithm shows you that you need at most $2\log N$.
 
 
3 hours later…
10:51 AM
So, I am writing a crypto utility for a Minecraft mod (just pointing out that security is not absolutely necessary, but would like to be as close as possible) using AES and SHA256. I want to store user's one-time use passwords in a file. Should I hash them? Do I also need to salt them? They will be 32 characters long random integers.
How would I generate such a salt?
 
 
2 hours later…
12:27 PM
@Restioson with entropy
 
@MickLH how would I replicate this entropy serverside?
 
@Restioson are these integers in decimal? are they picked uniformly at random or according to some distribution?
 
@SEJPM they are decimal
 
@Restioson lol ok step back for a second, I was being playful and this idea sounds misguided
 
I am not sure how reliably they are generated
@MickLH?
 
12:29 PM
@Restioson what function do you use to create them?
(if I'm guessing right they have about ~106 bit of entropy)
 
@SEJPM Lua's builting math.random
 
@Restioson ok, it uses a Mersenne Twister which is statistically random but if somebody tries (hard enough?) can be predicted
 
@SEJPM Computercraft doesn't have enough computing power for that realistically
 
@Restioson Don't make the mistake of thinking one specific attack is the only attack you need to measure the effort of
also I'd hope users aren't expected to remember a 32 digit long number, and assuming they aren't expected to remember it then you might as well use a larger alphabet to get more entropy in the generated keys
 
@MickLH 106 bit is more than enough
 
12:34 PM
more than enough?? it's so close to 128 :'(
 
@MickLH No, they aren't expected to remember it. I just think realistically it will just be deterrence, but you never know
@MickLH if it makes you feel better, its 256 bit
 
it makes me feel worse :(
if it just were hex instead of decimal it would be a clean 128 bit key by itself ready for a cipher
 
32 * 8 (ascii) = 256
But 256 is a nice number
 
@Restioson no
 
@SEJPM no to what?
@MichLH what about generating a uuid (which I cant verify) as a key?
 
12:35 PM
each character can only take 10 values making it more like 3.3bits of information per char
 
About the salt earlier, I meant to say: If you're generating a random key then a salt doesn't sound useful
 
@SEJPM in ascii it takes 1 byte to represent character
No matter how it could be represented
 
@Restioson yes, you store 256 bit, but these 256 bit only contain 106 bit of actual information
 
@Restioson actually 7 bits per character, but that's beside the point because ASCII includes a lot more than just the numbers 0 - 9
 
@MickLH noone uses the 8th bit :P
 
12:37 PM
Yeah so there goes an entire bit of each byte, completely predictable and worthless as far as key strength
 
@MickLH i thought something else was 7, (dos OEM? ibm OEM?) and ascii standardised to 8
true
224 bit then
 
SEJPM did the math for you: log2(10^32) =~106
 
I guess it would be 224 if I didn't have the numerical constraint
 
I still feel like this is beside the point in a way
Why are you using one time passwords?
 
@Restioson even then it would be lower because you probably won't use all the different whitespaces and stuff
 
12:40 PM
@SEJPM I can b64 encode it so I can
@MickLH lack of RSA
 
If you're gonna change the alphabet please just add A - F and then it'll be exactly 128 bits of entropy and you won't need a KDF
 
@MickLH if one password is used constantly and it is exposed...
@MickLH k
 
I feel guilty almost now, don't take away the idea that you can ever skip the KDF on a password
it's not a password at this point, it's a key
and you must convert the hex to binary before trying to use it as a key
 
Even 106 bit is "meh can't break"
 
@MickLH what's kdf?
 
12:43 PM
yeah you know what, please leave the alphabet how it was, I think it would be better practice to use a KDF
@Restioson key derivation function
 
@MickLH Why must I convert the b64 to binary
oh
doubt one is made for lua
in native
 
well I think you don't have to worry about dictionary attacks anyways so you wouldn't need a big slow kdf
 
Nope, I don't think so
@MickLH this is running inside a jvm inside a game which is usually run on toasters
I think sha is slow enough
:P
 
grr maybe sha is slow enough to stop you there but I'll just copy paste the hex out and run my lightning fast native sha here, but again getting beside the point
 
True, true
good luck getting copy to work in cc lmao
But I see your point
Sniff unencrypted (yuck why) packet from pc to server
 
12:47 PM
I think you can get away with sha for a different reason here, you don't really need a salt or a slow hash
 
ok
 
Because your "passwords" are randomly generated
You would use a salt to help slow down dictionary attacks usually
 
true
 
But the dictionary for your password distribution is worthless, it's just brute force since it's uniformly random over its domain
So just rely on the entropy of the password
 
But it's pretty easy to make a list of all numbers from 10^32 and 10^32 *9 + 10^31*9 ...
or 100000000000... to 9999999999999999...
 
12:50 PM
Yeah and each one is equally likely
So you're still at square one picking a random place to start
 
true
 
A dictionary attack is only useful when some items obviously go to the top of the list
 
so, hash them?
still?
Or is encryption fine
I'm encrypting other stuff as well
For privacy
 
Lets call it a a KDF not a hash here, just to keep it straight
We're using a hash as a kdf, but that's an implementation detail
 
I mean hashing to store
Oh, also as a kdf?
 
12:51 PM
You can't feed the raw number in as the encryption key
 
Will encrypting something with the same key with differing iv's each time suffice?
for file encrypting
 
Probably
But I'm still not sure what you meant at the beginning. Why are you storing these random keys and what is "one time" about them?
 
They are different each time
And discarded after use
 
So how do you deliver the new ones?
 
PACKET BREAKDOWN
----------------

Items enclosed in [] means that they are encrypted.

Pin IV [SHA256HMAC (Sender/Destination)* NextUUID NextMessagePassword NextHMACPassword Message]

* If implementation = server, then it will be who sent the packet. If implementation = client, then it will be destination for packet
Through the message
it is encrypted along with the message
 
12:55 PM
and the messages go over a secure channel?
 
no
But the message is encrypted
 
With what key?
 
Things in [] are encrypted
 
...so it's a secure channel?
 
The key sent in the last message, or if it is the first message then from the server
Well, yes
 
12:56 PM
ok why can't you just use that?
 
A secure layer over an unsecure channel
Because I have to create the secure layer
Anyone can sniff the channel
like radio
It's meant to immitate radio, actually
 
Lets start from the top: How do you distribute these randomly generated keys?
I take it you send them over network, but how specifically? Is it through a TLS socket, or an insecure socket?
 
insecure
It's in a game
which makes you do your own encryption
The first key for a user will be distributed via paper and pen, so to speak
 
There we go
 
But I obviously don't want to redistribute it every time
 
1:01 PM
Ok so all you need to do is KDF that paper & pen code up to a full 128 bit random block, and that's your key
Then you can just use regular authenticated encryption for your messages
 
@MickLH what is regular ?
I can't use TLS/SSL/RSA due to unavailability
@MickLH I will generate it and then run a SHA-2 hash on it
 
Authenticated encryption is the combination of encryption with authentication
Like a block cipher combined with an HMAC, for example
 
The way I do it atm is relying on the fact that you are the only one with the key, therefore the only possible sender
But I do also have an HMAC
It is encrypted
Should it not be?
 
You probably want to do the HMAC of the encrypted data itself (after it's encrypted, I mean)
 
Oh, ok
 
1:04 PM
That way you can reject the HMAC before trying to decrypt the ciphertext
 
So far I do it of the nonencrypted data
yeah
 
Ok so you said you want to cycle the keys also...
 
Cycle?
 
Er, update
 
yes
 
1:08 PM
Ok so first if someone captures your packets now, they can break your forward secrecy later if they get one of the keys
 
true, true
I thought of that but had no idea how to stop it :/
 
I don't think it's a serious concern
 
FYI I am storing the user's details on their side using one password but changing the IV's each time
 
I'm just pointing out there's no magic bullet against the key being compromised
 
I'm not too worried about that: if the hacker has access to your computer, you're pretty much toast
Yeah
Planning to implement the system in which the user encrypts it with their key, and then so does the server, and then they send it back and forward decrypting it until the server has decrypted it
maybe for key dist
 
1:11 PM
Though you do get the benefit of being able to ditch any would-be hacker by getting just one key update outside of their view, so maybe exchanging a new key every session isn't a bad idea
As for actually sending the new key, this is a solved problem called key wrap
 
Is that what it is called
I have heard of it, but didn't know a name for it exactly
 
I personally really like the simplicity of the synthetic IV approach
 
Hm?
Making up the iv each time?
 
but lets not screw around yet :P
 
I think I found that on crypto.se tbh xD
 
1:14 PM
I want to re-visit the original key
 
Because I did a lot of research for this (relative to how much work it needs)
Yeah?
 
Built in random generators often suck, beware
 
Yeah
 
If the rng isn't seeded well, the security is fucked
And SEJPM pointed out that a more advanced attack is possible earlier
 
how should I seed it?
Realistically the only way to break this is anything but brute force
due to lack of allocated computing power
 
1:16 PM
well consider first that Mersenne Twister isn't really crypto grade so it might be possible to use some generated passwords to figure out the next generated password
 
I'll see if someone has written a crypto grade one for cc
 
and stop thinking about how weak any specific machine is
your opponent will always just use the fastest thing on the market
always
 
yeah
But most people who play minecraft are lazy
and nothing really secret is being transferred
but just for fun and to learn essentially
 
Lol you came to crypto.se not obfuscation.se :P
 
What about the ISAAC csprng?
Because I wanted to learn about crypto by doing this, not obfuscation
 
1:18 PM
I like ISAAC, as far as I know it's not broken
I remember it being fast too, oh but also someone found biases in the first round so discard the first round before using the random outputs
Also the seed is possibly more important than the choice of random generator at all
 
how should I seed it?
 
get at the system entropy pool somehow
 
Biv
/dev/urandom ?
 
Users dont neccessarily want to have to type random stuff every time they send a message
@Biv inside computercraft minecraft mod lmao
 
Biv
I'm sorry I'm more about real world oriented
 
1:21 PM
I dont get the point of rng's if you have to seed them randomly anyway...
 
Biv
currently designing a toy cipher for my students....
 
@Biv yeah. It's a bit of a weird question x.x
 
@Restioson several reasons, they look random whether or not you seed them which is enough for most programs :P
 
@MickLH so, do I need to seed it?
 
absolutely
 
1:22 PM
how?
 
/dev/urandom is the entropy pool on unix-like systems
I think windows has an API called CryptGenRandom
 
Yeah
From user, correct?
 
However you do it, you'll need entropy
 
OH GOD
I just ran cat on /dev/urandom
I am shaken, truly
Got a heart attack
 
lol
 
Biv
1:24 PM
xD
 
did your motherboard beep ;)
 
tail -f wasn't working
wait ill try again
no
i sense a joke I don't get
@MickLH so how should I seed it?
I obviously can't use something like the time
 
nah it just used to catch me off guard when my motherboard beeped unexpectedly on my old pc :P
 
that's just rude
Could I make them type a whole bunch of random stuff for the entropy pool?
 
If you print 0x07 byte to the console it usually makes it beep
 
1:26 PM
well
I screwed my computer
Ah, at least it's only my Ubuntu subsystem
it only types in nonprintables now
 
@Restioson Bleh you could in theory with a carefully designed randomness extractor, but they would need to type a lot because humans don't really produce very uniform of randomness. Why can't you just use /dev/urandom?
 
@MickLH it doesn't exist on cc
WAIT
Minecraft does have a source of randomness
Chickens - Don't laugh, they walk in random patterns
 
We need entropy not randomness
 
but takes too long
hm?
lmao broke my pc
 
ok so you know what I would do? just not try to generate the keys from within minecraft
 
1:31 PM
Can't
But it doesn't need to be too secure, so isn't just mersenne twister fine?
 
without a seed nothing has a chance lol
 
why?
 
because without a seed you'll get the same random key every time lol
or same list of random keys if you generate more than one
 
No
Not same everytime
 
you can just hope that your environment's random generator is pre-seeded... which you can easily test by running a program twice that outputs a random value
but there's a good chance you're reducing your security level to 32 bits by doing that :P
 
1:34 PM
It is pre-seeded
 
With how much entropy?
You can cut your generated passwords down to as short as the entropy of your seed
Don't worry about it for now
 
k
Thanks so so much!
 
You can always fix up the seed later
Make sure your authentication is done right
 
Hmac?
 
That's way too easy to fuck up
 
1:41 PM
Inside or out?
(Encryption)
 
I think a sound system can be designed on either premise
 
Ok
But out for speed
 
But the important detail here that usually gets screwed up is the timing side channel
 
What is that?
 
Make sure you compare every character of the MAC, don't stop and return false early if one doesn't match
 
1:43 PM
I'm just using the default comparison operator
Why not return early?
 
if you do that, then the timing tells me if I got 1 character correct, or 2, or 3, etc...
 
Yeah?
If one is wrong, the the whole thing is wrong, right?
awjdw =/= awhdw
 
If you let me know how many characters were wrong though, I can cheat
I only have to guess the first letter, very few guesses
One of them has 1 correct, the rest have 0
 
Well, it doesn't tell you how many are correct
I don't really understand
 
Yes it does, it returns early
The timing exactly measures how many were correct
 
1:46 PM
Ohhh
I see
hm
 
Once I know the first letter is lets say "x", I can guess one more letter by trying "xa", "xb", ...
they will all have 1 match, except the correct next letter will have 2 matches
so now it's only brute forcing a 1 character password 32 times
instead of brute forcing a 32 character password
 
Im going to write something to see if there is a difference
too quick lma
lmao*
 
How's your stats skills?
 
Me?
 
Yep
 
1:52 PM
Don't know much about stats
 
Then I don't expect your attack to work
 
Hm?
Which attack?
 
These timing side channel attacks are carried out using programs that collect statistical information over many many attempts
 
brb
 
2:16 PM
back
 
ok @Restioson ready for synthetic iv lol
 
@MickLH just need to do some hw quick
Find out about africa is hard
 
africa?? pffff
 
Really?
Try find out where the Shona got their soapstone
takes a while
offtopic
 
gotta do africa studies because that comes in handy so often lol
 
2:24 PM
Because its interesting and I'm from South Africa
Comes in handy that I do Xhosa so i can pronounce stuff
 
lol I always poke fun about history topics
 
lol do some history then
 
pffffff
I feel we should be condensing the lessons of the past forward, not be expected to review the entire past
 
Well, we don't exactly know how to build drywall structures which for 1000 years, do we?
So it's useful to look at history
Hey
Do you know what happens when I can go to a place and it will work
 
lets not even start down that road, though you just gave a great argument for my point
 
2:29 PM
But for others they get an invalid cert?
lol
 
did you not update your browser lately?
 
It's chrome
if i go "https://<place>" then it gives me the warning
Also, is this chat encrypted? Would be very ironic if not
 
pretty sure wosign got pulled out of mainstream certs recently
it wouldn't make sense to encrypt this chat
the logs are public
 
Well
Encryption4everything
I wouldn't be comfortable if someone was reading this like the NSA
Does SE have a geology site?
Found it
 
encryption4everything?? says mr I cant afford a Kdf lol!
 
2:33 PM
I don't have a kdf
but true
 
OK here's the trick behind synthetic IV: you HMAC the inner plaintext, now use the MAC as the IV also
 
?
Does the iv need to be an array of numbers?
 
(instead of a random IV)
 
2:51 PM
How would I convert it into an array of numbers?
hex -> dec?
 

« first day (2078 days earlier)      last day (2593 days later) »