Hi, I need to make a component to sign (with coderanch, private keys)and crypt an info and send it from a web server to a web server. My first approach was to use a SignedObject but have some problems to put it on an input tag and send it by post to a
servlet in the other side
(This is my first work with security issues...)
Then, I make the signature for my data(using SHA1withRSA), and try to put the data and the signature together, to crypt it all with RSA.
Mi first problem concerns to how put the data and the signature together, because when I cript the result and decript in the "other side", I don't know where the original data ends and the signature starts.
Tryed to put first, the size of the data, second the data and third the signature, but when I cript all (the result is a nice byte[]) and decrypt
in the other side the info is not the same !
Since "new
String(byte[])" and String.getBytes() doesn't work like I expected ( byte [] a --> String s --> byte[] b ==> a != b ), I need to disturb the peace of the ranch and make this silly question !!!
Somebody could help me ?
Again, this is my first approach to security and JCE, I send two days reading about security, certificates, algorithms, providers, signatures, keys (etc...) and this is my last resource...
Thanks for reading my long, very long post.
Saludos:
Carlos.-