Cryptography: RSA Questions

D

David

1) Is RSA used by other programming system? Eg. If I gen. a key,
can I share it and someone with Java, etc. access it?

2). When generating a public key, you get <Modulus> and <Exponent>
values. What parts do you need to share with someone. Also, what is
the correct format for these values?

3) If someone gives me their public key, how do I format it for
XML? Eg. do I need to convert the key in any way or just add a new
XML file and put in the key values?

Thanks
 
M

Mehdi

1) Is RSA used by other programming system? Eg. If I gen. a key,
can I share it and someone with Java, etc. access it?

Yes. RSA is a standard and implementations of the RSA algorithm exist for
many different languages and patforms including Java. (whenever you acess
an https:// web page, it is the RSA alorithm that is used to encrypt your
data)
2). When generating a public key, you get <Modulus> and <Exponent>
values. What parts do you need to share with someone.

Both (be carefull, you only need to send the public exponent. The private
exponent is for you to keep secret and will allow you to decrypt the data
encrypted with your public key)
Also, what is
the correct format for these values?

Encryption keys are just byte arrays. So there is no format per se. Just
send the byte arrays. One thing that might cause problems is that some
implementations use little endian while others use big endian for their
encryption keys byte arrays. For example, Windows' Crypto API uses little
endian while .NET's implementation uses big endian (or the opposite, i
forgot). So if for example you generate a key using .NET and send it to a
program that uses Crypto API to use this key, you will first need to
reverse the byte array before being able to use it. Apart from that, it
should work just fine.
3) If someone gives me their public key, how do I format it for
XML? Eg. do I need to convert the key in any way or just add a new
XML file and put in the key values?

I'm not sure what you mean here. Keys are just byte arrays as i said. I you
want to store it in a binary file, just write the byte array to the file.
If you want to store it to an XML file, you'll first need to convert your
key into displayable caracters. To do that, use the Base64 encoding. Then
write the resulting string in your XML file. When you'll need to use the
key, extract the string from the XML file and use Base64 to retrieve the
key's byte array. Note that .NET's crypto classes have fonctions that
allows you to store your key in XML format and retrieve your key from XML.
I've never used them but i suppose that these fonction do what i've just
described.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top