Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2020, 20:33
TempoMat TempoMat is offline
Friend
 
Join Date: Jan 2006
Posts: 89
Rept. Given: 10
Rept. Rcvd 6 Times in 6 Posts
Thanks Given: 4
Thanks Rcvd at 28 Times in 21 Posts
TempoMat Reputation: 6
Quote:
Originally Posted by chants View Post
This is pretty basic computer science stuff here. Converting between data types and bases. Since you appear to want to use bignums though the best we can give you is pseudo code for languages like C#or Java.
I wanted to avoid using the BigNum library.

Quote:
Originally Posted by chants View Post
The implementation details of bignum which likely converts the byte array first into an int array for efficient computation are another question altogether. Though implementing a bignum library from scratch is not too difficult and a good learning experience.

So the byte array practically speaking is useless. You need division and modulo by 34 so no tricks there. Now base 32 as a power of 2 would be a different story. In conclusion get or make a bignum library, convert your byte array, and to be efficient make a diagram function and loop on it as you do the conversion. Gor decoding same thing just multiply by 34 and add.
Sorry for not making myself clearer.
I am familier with the use of BigNumber libraries.
For instances I have been able to factorize some modulus N numbers upto 512 Bits and with the help of an assembler code Ziggy (thanks a bunch for that) provided me some years ago, been able to keygen a lot of apps with the use of one or a combination of Drizz, Fleur or FGIntRSA libraries.

So on 12.03.2020 after my last post, I did the rough asm implementation with Fleur's BigNum library in the form
Code:
Base34CharSet='ABCDEFGHIJKLMNPQRSTUVWXYZ123456789' ; as an example
bnX ;== The BigNumber
bnY ;== TheBase in this case 34 
bnRem
.repeat
   BigDiv32, bnX, bnY, bnRem, 0
   Out(i)=Base34CharSet(bnRem)
   inc i
.until bnX=0
The results were ok for a regular Base34 encoding.
I forgot to give a feedback after that. Sorry for that

The results however did not correspond to the samples of Base34Strings I fed in to the Progi to decode.
It is a simple RSA 120-Bit with what now looks like a home breed Base342ByteArray decoding routine.

Quote:
Originally Posted by chants View Post
Now base 32 as a power of 2 would be a different story.
Yes bases with powers of 2 are relative easy to implement.
An example will be to convert the ByteArray to binary bits and then convert the resulted bits in groups (size of a group corresponding to the nibble size of the base) for the indices to access the BaseXCharSet.

I must applaud the author for only including the Base34 decoding algorithm in his app and also not using those default ciphers in the BigNum library he used for the asymmetric encryption.

I will continue to analyze his decoding algorithm to see if I can somehow be able to reverse it.

Thanks again to all.
Reply With Quote
The Following 2 Users Say Thank You to TempoMat For This Useful Post:
Artic (03-16-2020), chants (03-15-2020)
  #2  
Old 03-29-2020, 01:36
TempoMat TempoMat is offline
Friend
 
Join Date: Jan 2006
Posts: 89
Rept. Given: 10
Rept. Rcvd 6 Times in 6 Posts
Thanks Given: 4
Thanks Rcvd at 28 Times in 21 Posts
TempoMat Reputation: 6
Resolved:Code snippet for Base34 Encoding

Just want to give a feedback on how I resolved the problem:
There was a small trick I didn’t pay much attention to at the beginning.
The protection is an RSA-120 bits Sign algo for generating and then Base34 encoding the result to give key.
Now the trick with the decoding was what kept me trying different Base34 Encode/Decode routines.
This is the procedure used for generating or needed to create a valid key:
Code:
  1.	RSASign(15 ByteString)	=>Res1
   The 15.Byte is a checksum of the first 14 Bytes  with the bytes at position 1 and 3 interchanged
  2.	ByteArray2Binary(Res1)	=>Res2
  3.	First take and group the bits at the old positions of Res2 and then concat with the bits at the even positions=>Res3
  4.	RegistrationKey=Binary2Base34(Res3)
Regards,
TemPoMat
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange string encoding in C code dila Source Code 10 04-10-2018 03:45
Code timing snippet Git Developer Section 5 01-05-2018 02:05
Any ideas about executing phpinfo() in this code snippet XnHandt General Discussion 0 12-28-2012 00:46
How to execute a snippet of code before the main execution! Android General Discussion 8 10-04-2006 01:22


All times are GMT +8. The time now is 07:52.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )