Yup. I need to study up on the standard terms Rich. My pseudo-code is
not going to cut it! Yikes!
>> That is a skill that I am lacking in. I am wondering about how to
>> exploit using Math.random() in JavaScript to try bust my HMAC cipher.
>
> Why not start by determining if it is possible to exploit
> Math.random()?
>
> I.e., start small, then build up.
Actually, the only reason why I am prepending the plaintext with these
"random" bytes _before_ encryption is to be able to generate a different
ciphertext for the same plaintext on a per-encryption basis, aka every
time I click the encrypt button. So, starting really small, just might
be to actually eliminate them as a pure experiment: no random numbers at
all. I can do that on my site by setting the number of random bytes to
zero. Here are some examples encrypting the plaintext between the quotes
"Plaintext" using the default key with 64 "random" bytes, three encryptions:
79b0cd27a8fd6d28b115112966cd3defcf89267843ecbd7d26281f12f20b70bd1ae6b9b1427d53aa8e0a6f2aff64d1ed9f5483e1de3e9049f4826bfcfdec1abf32b9a33e97dd403ba9
a854296adb9aeb8fc317257974687daa1e13cccd941d5fce649d3112fd419a65facf6e1a97500124a6ab63de9fca6ebce18006fb3ed6e8c0f33ea689f2caed1b409eb4f4b9ff931f02
f24c5a383ac51a6b90f9cef640ce7981a0f95574c74967450fb5d0415a6fa96818068fa6d063e6f40266da2b5dd383a856f8670abc6278ae67237e6a657bab39c537de913c5c311b5b
Okay, the ciphertexts above all encrypt "Plaintext" using the default
key, and they are all different. Okay.... Let me set the number of
random bytes to zero. Here is the ciphertext:
b90427406e5d23109d
I can encrypt "Plaintext" a thousand times in a row now, and it is the
same using no random bytes:
b90427406e5d23109d
Okay.... This is raw. Imvho, wrt starting small, this is as small as I
can get. Let me think on this Rich...
You can decrypt it by going to the site, setting the number of random
bytes to zero, and copy-and-paste the ciphertext b90427406e5d23109d into
the ciphertext box and click decrypt.
Now, this is where the rubber hits the road, imvvvho... Any thoughts
about starting _this_ small? I think removing the damn random bytes just
might be a decent start?
>
> Hint: if Math.random() is your typical programming language random
> generator, it is possible to exploit it, because it was never intended
> to be 'secure'.
>
>> A long hard road indeed! ;^o
>
> Yup.
>
Big time! WOha!