|
Science Forum Index » Cryptography Forum » MAC question
Page 1 of 1
|
| Author |
Message |
| Antony Clements |
Posted: Wed Apr 30, 2008 1:07 am |
|
|
|
Guest
|
given that a modern MAC is a digest of a message, is it possible to create a
MAC of a byte array? if so, how? |
|
|
| Back to top |
|
| Joseph Ashwood |
Posted: Wed Apr 30, 2008 1:33 am |
|
|
|
Guest
|
"Antony Clements" <antony.clements@bigpond.com> wrote in message
news:A0URj.6264$ko5.5141@news-server.bigpond.net.au...
Quote: given that a modern MAC is a digest of a message, is it possible to create
a MAC of a byte array? if so, how?
Put them in, in order. So basically:
MAC_key()
for each byte i in array
MAC_add(array[i])
mac = MAC_finalize()
To verify perform the same operations, and compare the result.
Joe |
|
|
| Back to top |
|
| Antony Clements |
Posted: Wed Apr 30, 2008 3:34 am |
|
|
|
Guest
|
"Joseph Ashwood" <ashwood@msn.com> wrote in message
news:7EURj.307$pt3.79@newsfe02.lga...
Quote: Put them in, in order. So basically:
MAC_key()
for each byte i in array
MAC_add(array[i])
mac = MAC_finalize()
To verify perform the same operations, and compare the result.
Joe
Can you please further define the MAC_add function, if you are using element
i as the input the the hash, wouldnt the hash still spit out a full hash? or
are you creating a string from the byte array and using that to hash? |
|
|
| Back to top |
|
| Ertugrul Söylemez |
Posted: Wed Apr 30, 2008 5:06 am |
|
|
|
Guest
|
"Antony Clements" <antony.clements@bigpond.com> wrote:
Quote: Put them in, in order. So basically:
MAC_key()
for each byte i in array
MAC_add(array[i])
mac = MAC_finalize()
To verify perform the same operations, and compare the result.
Can you please further define the MAC_add function, if you are using
element i as the input the the hash, wouldnt the hash still spit out a
full hash? or are you creating a string from the byte array and using
that to hash?
Your favorite hash/MAC function implementation takes care of splitting
the message in appropriate blocks for you. That's what the 'MAC_add'
function does.
Regards,
Ertugrul.
--
http://ertes.de/ |
|
|
| Back to top |
|
| Antony Clements |
Posted: Wed Apr 30, 2008 7:33 am |
|
|
|
Guest
|
"Ertugrul Söylemez" <es@ertes.de> wrote in message
news:fv9gbu$io9$03$2@news.t-online.com...
Quote: Your favorite hash/MAC function implementation takes care of splitting
the message in appropriate blocks for you. That's what the 'MAC_add'
function does.
ok that's fair enough, but how does one create a MAC of a byte array? all
the hashes i've seen work on string inputs. so in my mind it would require
taking that byte array and transforming it into a string. is there any way
to produce a MAC that uses the byte array directly? |
|
|
| Back to top |
|
| Mark Wooding |
Posted: Wed Apr 30, 2008 7:43 am |
|
|
|
Guest
|
Antony Clements <antony.clements@bigpond.com> wrote:
Quote: given that a modern MAC is a digest of a message
Not true. Carter-Wegman MACs in particular don't work like that.
Quote: is it possible to create a MAC of a byte array? if so, how?
Most modern cryptographic primitives -- and particularly primitives for
symmetric cryptography -- work at the level of octet arrays already.
You don't need to do anything special.
-- [mdw] |
|
|
| Back to top |
|
| Ertugrul Söylemez |
Posted: Wed Apr 30, 2008 9:01 am |
|
|
|
Guest
|
"Antony Clements" <antony.clements@bigpond.com> wrote:
Quote: Your favorite hash/MAC function implementation takes care of
splitting the message in appropriate blocks for you. That's what
the 'MAC_add' function does.
ok that's fair enough, but how does one create a MAC of a byte array?
all the hashes i've seen work on string inputs. so in my mind it would
require taking that byte array and transforming it into a string. is
there any way to produce a MAC that uses the byte array directly?
Your question rather seems to be related to a particular programming
language.
Regards,
Ertugrul.
--
http://ertes.de/ |
|
|
| Back to top |
|
| rossum |
Posted: Wed Apr 30, 2008 9:04 am |
|
|
|
Guest
|
On Wed, 30 Apr 2008 12:33:07 GMT, "Antony Clements"
<antony.clements@bigpond.com> wrote:
Quote:
"Ertugrul Söylemez" <es@ertes.de> wrote in message
news:fv9gbu$io9$03$2@news.t-online.com...
Your favorite hash/MAC function implementation takes care of splitting
the message in appropriate blocks for you. That's what the 'MAC_add'
function does.
ok that's fair enough, but how does one create a MAC of a byte array? all
the hashes i've seen work on string inputs. so in my mind it would require
taking that byte array and transforming it into a string. is there any way
to produce a MAC that uses the byte array directly?
Most decent implementations will allow passing byte array parameters
into a MAC, that is probably more common than passing strings.
For instance Bouncy Castle's Java MAC interface
(http://www.bouncycastle.org/docs/docs1.6/org/bouncycastle/crypto/Mac.html)
includes:
void update(byte[] in, int inOff, int len)
which is the equivalent of "MAC_add()" and takes a byte array, offset
and length as a parameter.
rossum |
|
|
| Back to top |
|
| Antony Clements |
Posted: Wed Apr 30, 2008 4:58 pm |
|
|
|
Guest
|
"rossum" <rossum48@coldmail.com> wrote in message
news:qjug145jm6a5r1kmkj1a50fpclejvvefbt@4ax.com...
Quote: Most decent implementations will allow passing byte array parameters
into a MAC, that is probably more common than passing strings.
For instance Bouncy Castle's Java MAC interface
(http://www.bouncycastle.org/docs/docs1.6/org/bouncycastle/crypto/Mac.html)
includes:
void update(byte[] in, int inOff, int len)
which is the equivalent of "MAC_add()" and takes a byte array, offset
and length as a parameter.
rossum
Thanks mr Rossum, an inspiration as always |
|
|
| Back to top |
|
| |