Professional Documents
Culture Documents
1 of 6
https://sites.google.com/site/mobilesecuritylabware/3-data-location-priva...
Eclipse IDE
Android SDK
Tutorial
Lab1: RSA Encryption Program Video Demo
4/9/2015 9:59 PM
2 of 6
https://sites.google.com/site/mobilesecuritylabware/3-data-location-priva...
Go to Encrypt->src->Android.Encrypt->EncryptActivity.java
4/9/2015 9:59 PM
3 of 6
https://sites.google.com/site/mobilesecuritylabware/3-data-location-priva...
java.security.KeyPair;
java.security.KeyPairGenerator;
java.security.PrivateKey;
java.security.PublicKey;
output.setText(String.valueOf(decrypt(Raw.getText().toString())));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
4/9/2015 9:59 PM
4 of 6
https://sites.google.com/site/mobilesecuritylabware/3-data-location-priva...
4/9/2015 9:59 PM
5 of 6
https://sites.google.com/site/mobilesecuritylabware/3-data-location-priva...
{
String item = new String(b, n, 2);
b2[n/2] = (byte)Integer.parseInt(item, 16);
}
return b2;
}
Save and run the project, enter a message in to the Input textbox, click the Encrypt it by PublicKey button, the result will be like this.
Sample QR(Use Barcode Scanner on your Android Phone to scan this image):
Discuss Board:
4/9/2015 9:59 PM
6 of 6
https://sites.google.com/site/mobilesecuritylabware/3-data-location-priva...
Encrypt.apk
Zhengzhe Li,
v.7
Hello_world.apk
Zhengzhe Li,
v.7
Hello_world_QR.jpg
Zhengzhe Li,
v.7
Layout_Outline.jpg
Zhengzhe Li,
v.7
bq.png
Zhengzhe Li,
v.7
decrypt.jpg
Zhengzhe Li,
v.7
encrypt.jpg
Zhengzhe Li,
v.7
image002.jpg
Zhengzhe Li,
v.7
image004.jpg
Zhengzhe Li,
v.7
image006.jpg
Zhengzhe Li,
v.7
layout.jpg
Zhengzhe Li,
v.7
line.jpg
Zhengzhe Li,
v.7
Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites
4/9/2015 9:59 PM