Answer the question
In order to leave comments, you need to log in
How to deal with this cipher?
here is the text itself that needs to be decrypted Lbc5OJkdOZyqri8OF89kBA%3D%3D
An example of what should happen after decrypting from 9MaGC081K1jLXeMyHUCwWg%3D%3D
to 0862352228
, from OrBlChFU%2F7WYSJG54o5gJg%3D%3D
to0831446070
Answer the question
In order to leave comments, you need to log in
Total:
Cipher - 3DES/CBC padding mode = PKCS5, key="F9nA5uH8CeWreBraCRukaChe" IV="pUJeQ3Tr"
>>> import pyDes
>>> import base64
>>> data = base64.b64decode("9MaGC081K1jLXeMyHUCwWg==")
>>> f = "pUJeQ3Tr".encode('ascii')
>>> b = "F9nA5uH8CeWreBraCRukaChe".encode('ascii')
>>> k=pyDes.triple_des(b,pyDes.CBC,f,pad=None,padmode=pyDes.PAD_PKCS5)
>>> print(k.decrypt(data))
b'0862352228'
>>> data2 = base64.b64decode("Lbc5OJkdOZyqri8OF89kBA==")
>>> print(k.decrypt(data2))
b'0874271626'
Lbc5OJkdOZyqri8OF89kBA%3D%3D
is Lbc5OJkdOZyqri8OF89kBA==
$ echo Lbc5OJkdOZyqri8OF89kBA== | base64 -d
-�98�9���/�d
Okay, so then$ echo Lbc5OJkdOZyqri8OF89kBA== | base64 -d | hexdump -C
00000000 2d b7 39 38 99 1d 39 9c aa ae 2f 0e 17 cf 64 04 |-.98..9.../...d.|
00000010
Well, as far as I can see, you are only interested in two pieces of code.
Initialization (abbreviated):
this.d = Cipher.getInstance("DESede/CBC/PKCS5Padding");
this.e = new SecretKeySpec(this.b, "DESede");
this.f = "pUJeQ3Tr".getBytes();
this.g = new IvParameterSpec(this.f);
this.d.init(2, this.e, this.g);
str2 = new String(this.d.doFinal(Base64.decode(URLDecoder.decode(str, "UTF-8"), 0)), "UTF-8");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question