encrypt password in android(client side) and decrypt in server side PHP with rsa

I have encrypt my password in android(client side) with rsa. As we know its using public key to encrypt and private key to decrypt. i generate public key and private key like code below

KeyPairGenerator gen = KeyPairGenerator.getInstance(RSA);

    gen.initialize(1024, new SecureRandom());

    KeyPair keyPair = gen.generateKeyPair();

    uk = keyPair.getPublic();

    rk = keyPair.getPrivate();

im succes to encrypt and decrypt this in android with this key. but in server side, the person who handle decryption need my private key as result that generate. how i give that private key to person that handle server side to decrypt data with my private key.

thanks...


if you want to send encrypted string to your server, your server needs to have the key pair. while sending message from client, use the server's public key and in the server side decrypt the received message using the private key.

链接地址: http://www.djcxy.com/p/21780.html

上一篇: 解决方案签署证书

下一篇: 在android(客户端)加密密码并在服务器端用rsa解密PHP