| |
 |
|
|
Science Forum Index » Cryptography Forum » Idea for algo.
Page 2 of 3 Goto page Previous 1, 2, 3 Next
|
| Author |
Message |
| John E. Hadstate |
Posted: Wed Dec 31, 2003 6:48 pm |
|
|
|
Guest
|
"Peter" <peter_rabbit@shaw.ca> wrote in message
news:0NHIb.883354$pl3.606937@pd7tw3no...
Quote: you do not need to shuffle the whole array! Simply shuffle the byte just
used with 1 or 2 others. Written in VB6 I manage to encrypt ~7MB/sec on
a 1.8gig Pentium IV. True, other algos are faster, and then there are
some that are slower.
Anyways, you've answered part of my question sensibly. Thank you.
Peter
Okay. Now let's try for round 2. Suppose that instead of mapping your
plaintext bytes through these shuffled arrays you simply add a different
pseudo-random value (mod 256) to each plaintext byte. How is that better or
worse than your original proposal? Hint: functionally, it's exactly the
same thing!
So, what you've constructed is a stream cipher whose security lies in the
unpredictability of the PRNG. The shuffling twist may make it harder to
analyze the PRNG (because it adds state to whatever state is in the PRNG),
but that's all it does. If you've got a good PRNG (like AES in CTR mode)
and you're careful not to abuse it, you may have the basis for a secure
cipher system. |
|
|
| Back to top |
|
| Michael Amling |
Posted: Wed Dec 31, 2003 7:36 pm |
|
|
|
Guest
|
Peter wrote:
Quote: you do not need to shuffle the whole array! Simply shuffle the byte just
used with 1 or 2 others. Written in VB6 I manage to encrypt ~7MB/sec on
a 1.8gig Pentium IV. True, other algos are faster, and then there are
some that are slower.
Uh, how is it again that you choose the byte with which you're going
to shuffle the byte just used? (I presume that "shuffle" means
"exchange" in this context.)
--Mike Amling |
|
|
| Back to top |
|
| Michael Amling |
Posted: Wed Dec 31, 2003 7:36 pm |
|
|
|
Guest
|
Peter wrote:
Quote: you do not need to shuffle the whole array! Simply shuffle the byte just
used with 1 or 2 others. Written in VB6 I manage to encrypt ~7MB/sec on
a 1.8gig Pentium IV. True, other algos are faster, and then there are
some that are slower.
Uh, how is it again that you choose the byte with which you're going
to shuffle the byte just used? (I presume that "shuffle" means
"exchange" in this context.)
--Mike Amling |
|
|
| Back to top |
|
| Peter |
Posted: Wed Dec 31, 2003 8:01 pm |
|
|
|
Guest
|
it is, sort of a PRNG, based on the password. In this case it is the key
which, ofcourse, can be reconstructed with the right password. The
weakness is not the PRNG (or key), because it is not revealed or repeated.
Perhaps this cipher system is not better than adding, subtracting etc.
it simply is a different approach. The only difference to adding (Mod
256) that I see is, that in the 'adding scheme' the resulting Byte is a
direct consequence of and has a direct relation to the original Byte
through the applied function ((pt + x) mod 256). In the 'mapping scheme'
the original Byte and the resulting Byte only have a 'by chance'
relationship that is not a consequence of a direct mathematical
function. (?). You may be right that this is not more secure, but is it
less so?
Peter
Quote: Okay. Now let's try for round 2. Suppose that instead of mapping your
plaintext bytes through these shuffled arrays you simply add a different
pseudo-random value (mod 256) to each plaintext byte. How is that better or
worse than your original proposal? Hint: functionally, it's exactly the
same thing!
So, what you've constructed is a stream cipher whose security lies in the
unpredictability of the PRNG. The shuffling twist may make it harder to
analyze the PRNG (because it adds state to whatever state is in the PRNG),
but that's all it does. If you've got a good PRNG (like AES in CTR mode)
and you're careful not to abuse it, you may have the basis for a secure
cipher system.
|
|
|
| Back to top |
|
| Peter |
Posted: Wed Dec 31, 2003 8:01 pm |
|
|
|
Guest
|
it is, sort of a PRNG, based on the password. In this case it is the key
which, ofcourse, can be reconstructed with the right password. The
weakness is not the PRNG (or key), because it is not revealed or repeated.
Perhaps this cipher system is not better than adding, subtracting etc.
it simply is a different approach. The only difference to adding (Mod
256) that I see is, that in the 'adding scheme' the resulting Byte is a
direct consequence of and has a direct relation to the original Byte
through the applied function ((pt + x) mod 256). In the 'mapping scheme'
the original Byte and the resulting Byte only have a 'by chance'
relationship that is not a consequence of a direct mathematical
function. (?). You may be right that this is not more secure, but is it
less so?
Peter
Quote: Okay. Now let's try for round 2. Suppose that instead of mapping your
plaintext bytes through these shuffled arrays you simply add a different
pseudo-random value (mod 256) to each plaintext byte. How is that better or
worse than your original proposal? Hint: functionally, it's exactly the
same thing!
So, what you've constructed is a stream cipher whose security lies in the
unpredictability of the PRNG. The shuffling twist may make it harder to
analyze the PRNG (because it adds state to whatever state is in the PRNG),
but that's all it does. If you've got a good PRNG (like AES in CTR mode)
and you're careful not to abuse it, you may have the basis for a secure
cipher system.
|
|
|
| Back to top |
|
| Peter |
Posted: Wed Dec 31, 2003 8:35 pm |
|
|
|
Guest
|
quite a simple exchange (swap) of the byte involved with 2 others.
a= a_key(x) 'the involved Byte
a_key(x)=a_key(y)
a_key(y)=a_key(z)
a_key(z)=a
it is actually a bit more involved, since you must shuffle 2 arrays, the
a_key and the ref. array. I don't want to bore everybody with the
details and wear out my already thin welcome here, but to anyone
interested, I'll gladly mail the whole thing. (be forewarned, though, it
is in VB6 and not in God's language C)
Peter
Michael Amling wrote:
Quote: Peter wrote:
you do not need to shuffle the whole array! Simply shuffle the byte...
Quote: Uh, how is it again that you choose the byte with which you're going
to shuffle the byte just used? (I presume that "shuffle" means
"exchange" in this context.)
--Mike Amling
|
|
|
| Back to top |
|
| John Savard |
Posted: Wed Dec 31, 2003 9:47 pm |
|
|
|
Guest
|
On Wed, 31 Dec 2003 18:48:19 -0500, "John E. Hadstate"
<jh113355@hotmail.com> wrote, in part:
Quote: "Peter" <peter_rabbit@shaw.ca> wrote in message
news:0NHIb.883354$pl3.606937@pd7tw3no...
you do not need to shuffle the whole array! Simply shuffle the byte just
used with 1 or 2 others.
That *is* Terry Ritter's Dynamic Substitution.
Quote: So, what you've constructed is a stream cipher whose security lies in the
unpredictability of the PRNG. The shuffling twist may make it harder to
analyze the PRNG (because it adds state to whatever state is in the PRNG),
but that's all it does. If you've got a good PRNG (like AES in CTR mode)
and you're careful not to abuse it, you may have the basis for a secure
cipher system.
But it might be a way of making a PRNG better.
John Savard
http://home.ecn.ab.ca/~jsavard/index.html |
|
|
| Back to top |
|
| John Savard |
Posted: Wed Dec 31, 2003 9:47 pm |
|
|
|
Guest
|
On Wed, 31 Dec 2003 18:48:19 -0500, "John E. Hadstate"
<jh113355@hotmail.com> wrote, in part:
Quote: "Peter" <peter_rabbit@shaw.ca> wrote in message
news:0NHIb.883354$pl3.606937@pd7tw3no...
you do not need to shuffle the whole array! Simply shuffle the byte just
used with 1 or 2 others.
That *is* Terry Ritter's Dynamic Substitution.
Quote: So, what you've constructed is a stream cipher whose security lies in the
unpredictability of the PRNG. The shuffling twist may make it harder to
analyze the PRNG (because it adds state to whatever state is in the PRNG),
but that's all it does. If you've got a good PRNG (like AES in CTR mode)
and you're careful not to abuse it, you may have the basis for a secure
cipher system.
But it might be a way of making a PRNG better.
John Savard
http://home.ecn.ab.ca/~jsavard/index.html |
|
|
| Back to top |
|
| Simon G Best |
Posted: Thu Jan 01, 2004 2:35 pm |
|
|
|
Guest
|
Peter wrote:
Quote: it is, sort of a PRNG, based on the password.
It's an s-box. The s-box, rb, is constructed on the basis of the
password. The only part of the construction method you seem to have
given is the transformation from a_key to rb. After each substitution,
the s-box, rb, is altered on the basis of the output of a PRNG which you
haven't given.
Quote: In this case it is the key
which, ofcourse, can be reconstructed with the right password. The
weakness is not the PRNG (or key), because it is not revealed or repeated.
That last sentence doesn't make any sense.
Quote: Perhaps this cipher system is not better than adding, subtracting etc.
it simply is a different approach. The only difference to adding (Mod
256) that I see is, that in the 'adding scheme' the resulting Byte is a
direct consequence of and has a direct relation to the original Byte
through the applied function ((pt + x) mod 256). In the 'mapping scheme'
the original Byte and the resulting Byte only have a 'by chance'
relationship that is not a consequence of a direct mathematical
function. (?).
You've confused yourself with your idea of rb being an array of
references. rb is an s-box.
Quote: You may be right that this is not more secure, but is it
less so?
Peter
As you don't really understand your own scheme, it's a very safe bet
that it's horribly insecure. However, you don't seem to have said how
the array a_key is derived from the password, or what the PRNG is.
Without these rather essential details, it's rather impossible to say.
Simon |
|
|
| Back to top |
|
| Simon G Best |
Posted: Thu Jan 01, 2004 2:35 pm |
|
|
|
Guest
|
Peter wrote:
Quote: it is, sort of a PRNG, based on the password.
It's an s-box. The s-box, rb, is constructed on the basis of the
password. The only part of the construction method you seem to have
given is the transformation from a_key to rb. After each substitution,
the s-box, rb, is altered on the basis of the output of a PRNG which you
haven't given.
Quote: In this case it is the key
which, ofcourse, can be reconstructed with the right password. The
weakness is not the PRNG (or key), because it is not revealed or repeated.
That last sentence doesn't make any sense.
Quote: Perhaps this cipher system is not better than adding, subtracting etc.
it simply is a different approach. The only difference to adding (Mod
256) that I see is, that in the 'adding scheme' the resulting Byte is a
direct consequence of and has a direct relation to the original Byte
through the applied function ((pt + x) mod 256). In the 'mapping scheme'
the original Byte and the resulting Byte only have a 'by chance'
relationship that is not a consequence of a direct mathematical
function. (?).
You've confused yourself with your idea of rb being an array of
references. rb is an s-box.
Quote: You may be right that this is not more secure, but is it
less so?
Peter
As you don't really understand your own scheme, it's a very safe bet
that it's horribly insecure. However, you don't seem to have said how
the array a_key is derived from the password, or what the PRNG is.
Without these rather essential details, it's rather impossible to say.
Simon |
|
|
| Back to top |
|
| Simon G Best |
Posted: Thu Jan 01, 2004 8:24 pm |
|
|
|
Guest
|
Peter wrote:
Quote:
in this case the a_key is an s-box with values from 0 to 255. Here it is
not used as a PRNG, but under situations that req. PRNs betw. 0 and 255
it could be used as such.
You don't know what an s-box is, do you?
Quote: You've confused yourself with your idea of rb being an array of
references. rb is an s-box.
I disagree, the a_key is an s-box, but rb only serves as a reference to
where the plaint text byte is in the a_key. Perhaps we are splitting
hairs over semantics. You seem to be far more knowlegeable than I in
tthis matter so... you win.
Yes, as I said, you've confused yourself. rb is your s-box; a_key is
only used in rb's initial construction. What's particularly stupendous
is that the example you gave in your original post, where 834 -> 294,
nicely illustrates how rb is used as an s-box.
Quote: As you don't really understand your own scheme, it's a very safe bet
that it's horribly insecure. However, you don't seem to have said how
the array a_key is derived from the password, or what the PRNG is.
Without these rather essential details, it's rather impossible to say.
I understand my scheme just fine, I am just not too familiar with the
semantics of the trade,
That's like saying, "I understand my design for an aeroplane just fine,
I am just not too familiar with engineering," or, "I'm an okay surgeon,
I am just not too familiar with human anatomy."
Quote: that is why I ask questions, try to learn from
the comments of others and then answer other peoples questions to the
best of my abilities. If this newsgroup is for pros only please post a
sign!
To find out what this newsgroup is and is not for, I suggest you seek
out the FAQ. http://www.faqs.org/ might be worth trying.
Quote: As for your assumption that 'it is a very safe bet that it is horribly
insecure', I beg your indulgance to explain on what you base your
judgement.
Peter
You don't know what you're doing. It's clear that you don't know what
you're doing (as your confusion about which of your arrays is used as an
s-box clearly demonstrates). The chances of someone who doesn't know
what they're doing coming up with a strong, secure scheme are pretty slim.
Simon |
|
|
| Back to top |
|
| Simon G Best |
Posted: Thu Jan 01, 2004 8:24 pm |
|
|
|
Guest
|
Peter wrote:
Quote:
in this case the a_key is an s-box with values from 0 to 255. Here it is
not used as a PRNG, but under situations that req. PRNs betw. 0 and 255
it could be used as such.
You don't know what an s-box is, do you?
Quote: You've confused yourself with your idea of rb being an array of
references. rb is an s-box.
I disagree, the a_key is an s-box, but rb only serves as a reference to
where the plaint text byte is in the a_key. Perhaps we are splitting
hairs over semantics. You seem to be far more knowlegeable than I in
tthis matter so... you win.
Yes, as I said, you've confused yourself. rb is your s-box; a_key is
only used in rb's initial construction. What's particularly stupendous
is that the example you gave in your original post, where 834 -> 294,
nicely illustrates how rb is used as an s-box.
Quote: As you don't really understand your own scheme, it's a very safe bet
that it's horribly insecure. However, you don't seem to have said how
the array a_key is derived from the password, or what the PRNG is.
Without these rather essential details, it's rather impossible to say.
I understand my scheme just fine, I am just not too familiar with the
semantics of the trade,
That's like saying, "I understand my design for an aeroplane just fine,
I am just not too familiar with engineering," or, "I'm an okay surgeon,
I am just not too familiar with human anatomy."
Quote: that is why I ask questions, try to learn from
the comments of others and then answer other peoples questions to the
best of my abilities. If this newsgroup is for pros only please post a
sign!
To find out what this newsgroup is and is not for, I suggest you seek
out the FAQ. http://www.faqs.org/ might be worth trying.
Quote: As for your assumption that 'it is a very safe bet that it is horribly
insecure', I beg your indulgance to explain on what you base your
judgement.
Peter
You don't know what you're doing. It's clear that you don't know what
you're doing (as your confusion about which of your arrays is used as an
s-box clearly demonstrates). The chances of someone who doesn't know
what they're doing coming up with a strong, secure scheme are pretty slim.
Simon |
|
|
| Back to top |
|
| Peter |
Posted: Thu Jan 01, 2004 10:45 pm |
|
|
|
Guest
|
Quote:
it is, sort of a PRNG, based on the password.
It's an s-box. The s-box, rb, is constructed on the basis of the
password. The only part of the construction method you seem to have
given is the transformation from a_key to rb. After each substitution,
the s-box, rb, is altered on the basis of the output of a PRNG which you
haven't given.
in this case the a_key is an s-box with values from 0 to 255. Here it is
not used as a PRNG, but under situations that req. PRNs betw. 0 and 255
it could be used as such.
Quote: Perhaps this cipher system is not better than adding, subtracting etc.
it simply is a different approach. The only difference to adding (Mod
256) that I see is, that in the 'adding scheme' the resulting Byte is
a direct consequence of and has a direct relation to the original Byte
through the applied function ((pt + x) mod 256). In the 'mapping
scheme' the original Byte and the resulting Byte only have a 'by
chance' relationship that is not a consequence of a direct
mathematical function. (?).
You've confused yourself with your idea of rb being an array of
references. rb is an s-box.
I disagree, the a_key is an s-box, but rb only serves as a reference to
where the plaint text byte is in the a_key. Perhaps we are splitting
hairs over semantics. You seem to be far more knowlegeable than I in
tthis matter so... you win.
Quote: You may be right that this is not more secure, but is it less so?
Peter
As you don't really understand your own scheme, it's a very safe bet
that it's horribly insecure. However, you don't seem to have said how
the array a_key is derived from the password, or what the PRNG is.
Without these rather essential details, it's rather impossible to say.
Simon
I understand my scheme just fine, I am just not too familiar with the
semantics of the trade, that is why I ask questions, try to learn from
the comments of others and then answer other peoples questions to the
best of my abilities. If this newsgroup is for pros only please post a sign!
As for your assumption that 'it is a very safe bet that it is horribly
insecure', I beg your indulgance to explain on what you base your judgement.
Peter |
|
|
| Back to top |
|
| Peter |
Posted: Thu Jan 01, 2004 10:45 pm |
|
|
|
Guest
|
Quote:
it is, sort of a PRNG, based on the password.
It's an s-box. The s-box, rb, is constructed on the basis of the
password. The only part of the construction method you seem to have
given is the transformation from a_key to rb. After each substitution,
the s-box, rb, is altered on the basis of the output of a PRNG which you
haven't given.
in this case the a_key is an s-box with values from 0 to 255. Here it is
not used as a PRNG, but under situations that req. PRNs betw. 0 and 255
it could be used as such.
Quote: Perhaps this cipher system is not better than adding, subtracting etc.
it simply is a different approach. The only difference to adding (Mod
256) that I see is, that in the 'adding scheme' the resulting Byte is
a direct consequence of and has a direct relation to the original Byte
through the applied function ((pt + x) mod 256). In the 'mapping
scheme' the original Byte and the resulting Byte only have a 'by
chance' relationship that is not a consequence of a direct
mathematical function. (?).
You've confused yourself with your idea of rb being an array of
references. rb is an s-box.
I disagree, the a_key is an s-box, but rb only serves as a reference to
where the plaint text byte is in the a_key. Perhaps we are splitting
hairs over semantics. You seem to be far more knowlegeable than I in
tthis matter so... you win.
Quote: You may be right that this is not more secure, but is it less so?
Peter
As you don't really understand your own scheme, it's a very safe bet
that it's horribly insecure. However, you don't seem to have said how
the array a_key is derived from the password, or what the PRNG is.
Without these rather essential details, it's rather impossible to say.
Simon
I understand my scheme just fine, I am just not too familiar with the
semantics of the trade, that is why I ask questions, try to learn from
the comments of others and then answer other peoples questions to the
best of my abilities. If this newsgroup is for pros only please post a sign!
As for your assumption that 'it is a very safe bet that it is horribly
insecure', I beg your indulgance to explain on what you base your judgement.
Peter |
|
|
| Back to top |
|
| David Eather |
Posted: Sat Jan 03, 2004 6:47 pm |
|
|
|
Guest
|
Comments for Peter from a (relatively) crypto newbe:
It would appear that your cipher can't be strengthened enough to be
secure in today's environment.
But there are several reasons to take heart -
- You have definitely moved out of the pen and pencil strength ciphers -
congratulations
VB is not the ideal language for measuring speed with - it has to drag
windows around with it
- your cipher is probably faster than you imagine. You could check by not
encrypting a file but rather a variable in memory (encrypt it as many times
as you need to for a measurable time - also make the variable small so it
all fits in the CPU cache. It sounds like cheating but isn't. In the end
you will get a figure that tells (in ideal circumstances) how long each
byte/block takes to encrypt without the need to wait for disk i/o, memory
access etc. That figure should be heartening.
- You re-invented something that was first described by someone else who
had more experience in crypto than you. So your thinking is not far off as
to be "out of the ball park" - perhaps John Savard can tell you more about
the effects of the swap function you reinvented.
Most people with an interest in crypto will remain enthusiastic amateurs,
some will become aficionados (hope the spelling is correct) and a very few
will become world class crypto gurus. (or if you prefer, most hobbyists,
some tradespeople and a very few artists). Read the faq sheet for sci.crypt
and try to get an introductory book on modern cryptography, "Applied
Cryptography" by Schneier is probably the easiest to get into, but it will
still be a steep learning curve.
Even if you never become a guru or artist with published ciphers and
"breaks" of other ciphers that need not stop you from experimenting in, and
enjoying cryptography.
"Peter" <peter_rabbit@shaw.ca> wrote in message
news:LPKIb.894773$9l5.45015@pd7tw2no...
Quote: quite a simple exchange (swap) of the byte involved with 2 others.
a= a_key(x) 'the involved Byte
a_key(x)=a_key(y)
a_key(y)=a_key(z)
a_key(z)=a
it is actually a bit more involved, since you must shuffle 2 arrays, the
a_key and the ref. array. I don't want to bore everybody with the
details and wear out my already thin welcome here, but to anyone
interested, I'll gladly mail the whole thing. (be forewarned, though, it
is in VB6 and not in God's language C)
Peter
Michael Amling wrote:
Peter wrote:
you do not need to shuffle the whole array! Simply shuffle the byte...
Uh, how is it again that you choose the byte with which you're going
to shuffle the byte just used? (I presume that "shuffle" means
"exchange" in this context.)
--Mike Amling
|
|
|
| Back to top |
|
| |
Page 2 of 3 Goto page Previous 1, 2, 3 Next
All times are GMT - 5 Hours
The time now is Sun Oct 12, 2008 5:28 pm
|
|