[RESOLVED] Encrypt in Vb6 Decrypt in c#
Hi,
I have a VB6 application that should encrypt a string using a public key and a C# application decrypt using a private key.
Following situation. I created a Certificate containing a public and a private key. in my certstore and exported the keys to files ( .pfx,.cer )
so basicly i have the methods in vb to decrypt a string but only with .prk and .pbk files but i cant find a way to get the keys stored in the .pfx file out to use them with my crypto api calls.
So im pretty new to all this crypto stuff and maybe im doing something completley wrong here... so just forgive me if im talking bs here :)
thanks in advance
as
Re: Encrypt in Vb6 Decrypt in c#
ok i just found ( after hours of googling around ) a much simpler access to my issue using the RSACryptoServiceProvider ... so now i have a much simpler problem: when I encrypt the string and the decrypt it everythings just fine... but if i want to save the encrypted string to a file ( to read the file in my c# app afterwards ) it only saves Questionmarks : "?????????????????????????????????"
why is that? and much more important... how to avoid that??
Re: Encrypt in Vb6 Decrypt in c#
Maybe you should show us the code you are using to make the file, and to read the file ?
Re: Encrypt in Vb6 Decrypt in c#
well it was just a noob failure of mine i forgot to convert the byte array to a string before writing it to a file. anyway im writing it to the database now. everything works fine.
thanks for your reply anyway
bye
as
Re: Encrypt in Vb6 Decrypt in c#
Dont forget to Resolve your thread from the "Thread Tools menu > Mark Thread as Resolved" so others will know your question has been answered. ;)