Re: Public Keys and Signed Executables

From: Steven Pratschner [MS] (stevenpr@online.microsoft.com)
Date: 04/23/03


From: "Steven Pratschner [MS]" <stevenpr@online.microsoft.com>
Date: Tue, 22 Apr 2003 17:47:44 -0700


Hi Heath - How are you extracting the public key from the assembly? Can you
send us the code snippet? .snk files have a little header that we stick on
the front that contains things like the algorithm, key length and so on.
Its possible that the key you're getting out of the assembly doesn't have
this header.

Thanks,
Steven

"Heath Stewart" <nospam.clubstew@hotmail.com> wrote in message
news:OKni9$bBDHA.1220@TK2MSFTNGP11.phx.gbl...
> I've been doing some work with signed XML where I sign the original XML
> document as an enveloped signature and I don't store the public key in the
> KeyInfo section. The NT Service that would read the file would use the
> public key from the same key pair file it was signed with (as well as the
> XML doc) to verify the signature. After doing a lot of research and
testing,
> I've discovered something very odd and hopefully someone here can explain
to
> me what is happening.
>
> Let say my key pair is KeyFile.snk. All .NET assemblies are signed with
this
> key pair and it is in a key store. If I extract the public key with
> "sn.exe -pc Proplanner Pubkey.key", it gives me the public key. Through a
> little console-based application I wrote, I get the public key from the
> assembly (remember, it was signed with the same key pair), do some
> byte-swapping (since it's stored as big-endian), and save that to
> Pubkey2.key. Now, these should be the same, right? Actually, only the
> Exponent is the same. The modulus is completely different!
>
> Why would the public key be different between the key pair file and the
> assembly that was signed with the same key pair file? Or, at least why is
> the modulus different? Looking at the actual structure of each, everything
> else is the same (i.e., the BLOBHEADER and RSAPUBKEY structures).
>
> Also, I'm using different combinations of the .NET Frameworks security
> implementation, the WSE, the CryptoAPI, and even direct byte manipulation
> and I always come up with the same results.
>
> TIA
>
> --
>
> Heath Stewart
> Software Engineer / Network Administrator
> Proplanner.NET: Web-based Production Planning Solutions
> http://www.proplanner.net
>
>



Relevant Pages

  • Re: Public Keys and Signed Executables
    ... Hi Heath - How are you extracting the public key from the assembly? ... .snk files have a little header that we stick on ... > public key from the same key pair file it was signed with (as well as the ... > key pair and it is in a key store. ...
    (microsoft.public.security)
  • Public Keys and Signed Executables
    ... I've been doing some work with signed XML where I sign the original XML ... document as an enveloped signature and I don't store the public key in the ... Let say my key pair is KeyFile.snk. ... Why would the public key be different between the key pair file and the ...
    (microsoft.public.dotnet.security)
  • Public Keys and Signed Executables
    ... I've been doing some work with signed XML where I sign the original XML ... document as an enveloped signature and I don't store the public key in the ... Let say my key pair is KeyFile.snk. ... Why would the public key be different between the key pair file and the ...
    (microsoft.public.security)
  • Re: Hash code with virtual memory address then encrypt, possible to attack?
    ... > It replaces the general-purpose processor with a box ... Could this key pair be generated by the processor ... the public key to the owner of the processor. ... The software producer needs the public key to encrypt ...
    (sci.crypt)
  • Re: Encryption question
    ... What you are saying, "take Alice's public key and create a key pair", is as ... > Alice encrypts her email to Bob using his public key. ...
    (Security-Basics)