Hello,

I've got a question about the encoding of an integer, specifically an

integer

within a public key.

In this public key, there are two integers, a modulus and a public

exponent.

The modulus is 64 bytes long but since integers are encoded in two's

complement,

there is a leading 00 byte so that the modulus is not considered

negative. Thus the

integer is 65 bytes

0241 00C8934A 22BE0C99......

The public exponent value is 65537. However it is encoded as

020301 0001.

65537 is 010001H which is 0000 0001 0000 0000 0000 0001B

Two's complement would be 1111 1110 1111 1111 1111 1110B + 1B =

1111 1110 1111

1111 1111 1111B

F E

F F F F

Does this look right? If so, the 65537 isn't encoded as two's

complement.

I created many public keys and the exponent was always encoded this way.

Any ideas why it doesn't seem to be two's complement?

I assume all integers are encoded as two's complement. But the public

exponent in

the public key does not seem to be encoded that way.

Thanks

Jim

--

Ericsson IP Infrastructure Voice (919) 472 - 9932

920 Main Campus Drive, Suite 544 Fax (919) 472 - 9999

Raleigh, NC 27606