Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cipher.doFinal hook by default (Feature request) #57

Open
cryptax opened this issue May 11, 2021 · 1 comment
Open

Add Cipher.doFinal hook by default (Feature request) #57

cryptax opened this issue May 11, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@cryptax
Copy link
Contributor

cryptax commented May 11, 2021

This is a feature request, not a bug. Fortunately, probably easy to add :)

I recommend you add by default hooks for Cipher.doFinal, and that in the hook, you show the input byte array argument and in the output, the returned byte array.

This is very helpful to view encrypted/decrypted data :)

@cryptax cryptax added the bug Something isn't working label May 11, 2021
@cryptax
Copy link
Contributor Author

cryptax commented May 11, 2021

  • would probably be interesting also to have a hook for SecretKeySpec.

For example this is my updated hook to show the byte array containing a key:

 var cls_e993875f544b941d768726a3a29599b5 = Java.use('javax.crypto.spec.SecretKeySpec');

 var meth_24275db9d75101d1dc0a116d9893fea2 = cls_e993875f544b941d768726a3a29599b5.$init.overload('[B','java.lang.String');

 meth_24275db9d75101d1dc0a116d9893fea2.implementation = function(arg0,arg1) {
    
 send({ id:"ZWRkMzg1ODU0OGJkM2EwOWI0ZTBjMzBjNjE3YmZkYmY=", msg:"javax.crypto.spec.SecretKeySpec.<init>(<byte>[]<java.lang.String>)<void>", data:{arg0:arg0, arg1:arg1,}, action:"None before", after:false  });
 var ret = meth_24275db9d75101d1dc0a116d9893fea2.call(this , arg0,arg1);
 send({ id:"ZWRkMzg1ODU0OGJkM2EwOWI0ZTBjMzBjNjE3YmZkYmY=", msg:"javax.crypto.spec.SecretKeySpec.<init>(<byte>[]<java.lang.String>)<void>", data:{}, action:"None before", after:true  });
        
 return ret;

dexcalibur-secretkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants