Dealing With Encryption In Mobile Application (Android)

Hi guys. It's been awhile since I post something. Today I will share some insight on dealing with encryption on mobile application.

As you all know, these days every mobile application have some sort of encryption in order to "secure" it. In most cases, encryption only been used to divert the main issue.

For example, the developer does not practice secure coding that pretty much ends up with a lots of security issue in the application. So, to solve this issue, they simply use encryption to simplify their work instead of fixing the code.  

In some cases, the developer might expose the secret key or hard-coded the key in the application. The secret key can be used to decrypt the data.

Now, lets see some of the example. *Do note that this can only be done if you have the key

1) When dealing with android application (apk file), we can use jadx to decompile the apk and search for the key. Below is the example of the key.


 2) After getting the key, we can decrypt the data. In this case, the application uses JAVA encryption.
You can refer this page for more details.
https://howtodoinjava.com/security/java-aes-encryption-example/
Normally encryption and decryption method is included with the key in the application.


3) Now we just need to copy and paste the encryption and decryption method. Then we will need to create a class that can print out the value so that you can start tampering with the data. Below is the example.


4) Then save it as jar file and we can start tampering with the encrypted data. Below is example of encrypted data.

 5) Run the jar file that can decrypt and tamper the data. Below is the example.



Now we can simply test all the encrypted data. Do note that you will need some programming skills/understanding to pull this off. So go and learn any programming language. It will surely helps in your work.

Credit to my colleague Izz for helping me with this stuff.

That's all from me for today. I will be posting more if I got any interesting knowledge to share.

Cheers.





Comments

Popular posts from this blog

Petraware pTransformer ADC before 2.1.7.22827 allows SQL Injection via the User ID parameter to the login form.

Setting up MobSF in Ubuntu 18.04

Setting up RMS in Ubuntu 18.04