FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Encrypt/decrypt compatibility with Microsoft Crypto API?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Encrypt/decrypt compatibility with Microsoft Crypto API? [message #173899 is a reply to message #173897] Wed, 11 May 2011 22:15 Go to previous messageGo to previous message
JohnT is currently offline  JohnT
Messages: 16
Registered: April 2011
Karma:
Junior Member
On Wed, 11 May 2011 15:03:49 -0600, Trevor wrote:

> We have a Windows program that we have developed that uses the Microsoft
> Crypto API to encrypt/decrypt data using a shared secret from which it
> derives a session key.
>
> I now need to be able to access that same data (stored in a database)
> from our web site using PHP. I've used mcrypt before, but that doesn't
> appear to be a compatible solution. I've done enough research to see
> that I might be able to use OpenSSL, but I have not yet been able to
> determine whether I'll be able to decrypt data that was encrypted with
> the MS Crypto API (as well as the reverse).
>

When I did something similar, I wrote a C applet to do this.
You can't use standard tools because Windows pads the data differently.

I used mcrypt with rijndael-128 and cbc
Has been working successfully for a number of years.

In order to get it to work, I had to do the en/decryption both ways in
windows, and keep the data at each step, then replicate the data at the
linux side.

I think the main issue is that on linux, the data is 0 padded.
On windows, the data is padded with a byte containing the length (in
bytes) of the padding.

Regards
JohnT
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: some of the issues of NOT storing images in a secure database..
Next Topic: New PHP tutorial
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 13 06:20:46 GMT 2024

Total time taken to generate the page: 0.04996 seconds