hedonisticangel
hedonisticangel
hedonisticangel
1 post
Don't wanna be here? Send us removal request.
hedonisticangel · 6 years ago
Text
Key Management Services Demo for Android With Alibaba Cloud KMS Service
Tumblr media
Learn how to use the Alibaba Cloud Key Management Service (KMS) to create, control and manage your encryption keys on your mobile device. Prerequisites You need an Alibaba Cloud account. If you want, you can register here for a free trial. Basic knowledge of Android / Java 1. Activate the KMS service Log in to Alibaba Cloud, go to the console and click on "KMS Service". Activate the service. Please take note of the region where you want to create the keys. I created them in Hangzhou. Follow this illustrative guide to obtain the access codes. Please make a note of all the keys. 2. Create an Android project Create an Android project with the name you want. I gave him the name "KMSSample". Select the minimum SDK and device compatibility. I refer to devices with minimum API level 19 and above (only for phones and tablets). Select "Empty activity" and continue. Keep all the default settings as shown and click Finish. 3. Set the code We only have one java file and all the code related to the application is in a single file. We need to update the code in MainActivity.java. We will go through a detailed description later. Please copy the following code in the MainActivity.java file. Now we have to update the strings.xml file with the relevant details. Make sure you download the dependencies. 4. Create and run the code We need to add two glasses to ensure the correct functioning of the project. If you not get it clearly keep in touch with
Mobile App Developer in Austin
. 5. Explanation of the code level In the onCreate method, we get references to all the UI objects and create OnClickListener and assign it to all buttons. We have four asynchronous managers responsible for the functionality: Credential encryption: create the key in the cloud and update it. We use the appropriate key to encrypt your username and password. Your key is not stored anywhere in your code Decrypt credentials: call cipherBlob, call the decryption API to decrypt information and display it on the screen. Escape characters such as nr t are retained after decryption, so formatted text can be encrypted. Module data encryption: this class encrypts the data of the complete module to show, above all, the uniqueness of the keys we receive from the server. Decrypt form data: this class decrypts module data. We store all encrypted data in SharedPreferences and retrieve it when we call the Decrypt activities. The Alibaba Cloud KMS service offers excellent service to recover keys and eliminate them at dizzying speeds. This gives the application a high level of security. As you can see, all methods are self-explanatory. If done correctly, all compile problems will be resolved, and the application will be installed by clicking the small Play button in the Android Studio status bar. I highly recommend cloning the repository - you will eliminate many manual bugs and you will have this app working in a few minutes.
2 notes · View notes