digital signature verification

General discussions related to php

Moderators: macek, egami, gesf

shanwu
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Mar 04, 2013 5:38 am

digital signature verification

Postby shanwu » Mon Mar 04, 2013 6:26 am

In android, I use the DSA algorithm to generate both private key and public key for each client APP user, I successfully encode the public key to byte array and convert from byte array to base64, then upload with other various information to the php server(for now I save the public key base64 value in the mysql database).

Is there any PHP tutorial teaching ppl how PHP deal with keys operation from what I have so far? such as get the public key's base64 value back to original DSA public key file, and decrypt msg encoded with private keys for authentication... ? I am trying to read a single public key and verify the user's digital signature which signed with user's private key.

For example, I have the public key file, UserId.key,

Code: Select all

    $fp=fopen("/public key folder/UserId.key","r");
    $pub_key=fread($fp,8192);


I was trying to make the above code work, but with no luck.

Thanks in advance !! :D

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: digital signature verification

Postby seandisanti » Mon Mar 04, 2013 11:24 am

This page has some info, and a lot of links to other php encryption resources. http://www.ibm.com/developerworks/opens ... p-encrypt/ keep in mind that it is a couple of years old, so some functions may be deprecated, but it should give you a good starting point and if anything doesn't work correctly, you can check php.net/function_name to see if it's been replaced, removed, etc.


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron