big integers

k0r54

New member
Joined
Feb 16, 2012
Messages
5
All,

I have a number: - 81001070841150780430

Is there a formula I can use to find the smallest whole number?

An example:

if the number is: - 3635215077376

I could for instance do: (124^3) * (124^3)

The problem with this example is that I just picked the number '3635215077376' after working out (124^3) * (124^3) - what I want to know how to do is how do I start with a large number like 3635215077376 and simplify it into something like (124^3) * (124^3)

By simplifying a large number, like in the above example, I can enter 124-3 in my program which means if 124 = a and 3 = b I can do a very simply formula (a^b)*(a^b).

As I say, I am struggling to reverse engineer this, and need to figure out how to get from any number that is 18 digits long to something that is essentially 4-6 digits long (in the above case 124-3).

The slight complication is that I am unable to use decimals so I need to keep it to whole numbers, but to find something that works every time is proving difficult. I know it will not be as simple as the above equation.

I think understanding the life cycle of these numbers might help:

I have worked these numbers out like above with me picking (a^b)


3 138 428 376 721 = (121^3)*(121^3)
3 462 825 991 689 = (123^3)*(123^3)
3 297 303 959 104 = (122^3)*(122^3)


**** I know that that equation just wouldn't cover all numbers but i am hoping a complex formula will

That means instead of the user entering: 3138428376721-3462825991689-3297303959104 they could enter 121-123-122-3

meaning I could in my program take the last digit as "to the power of" and then separate a=121, b=123, c=122, y=3 and then (a^y)*(a^y) then b and c and will then be back at the original number.

I have complete flexibility over the number of digits in the original number, the formula and the format of the input (i.e 121-123-122-3).

I think I am looking for a formula that can work out any 18 digit number in a consitant way.

I also thought I could possibly use some type of combination algorithm on the original number (313842837672134628259916893297303959104) in my case, and not use any arithmetic. Either way I am out of ideas :)

Any help or advice would be helpful.

Regards
A.
 
That number isn't very big, and so a standard primality test is doable. If I understand your question, you would like to factor these integers. This is called the factoring problem, and unfortunately an efficient method is not known (publicly, at least) to factor very large integers. Your only hope of very large integers is an efficient algorithm. There is a method using quantum computers which is polynomial-time, but that is another topic.
 
Another method: You could represent any 18 digit number in base 1000 using only 6 characters, only you would need 1000 distinct characters to choose. For instance, using digits, uppercase, and lowercase letters, you can represent any number from 0 to 56800235583 in 6 characters.
 
Many thanks for all the replies....

perhaps some background of my problem might help.

I am writing a c# program and am trying to get a licence key. I have the string "CZ0+vBr3QsfgEOz4YOheX6ZElP3oQwrQbcjMC/8y14s=" (this is my encrypted string).

This is essentially the licence key but I want the user to be able to type in a simple key rather than that. So I started by converting this string into decimal.

C=67
Z=90
0=48
+=43

and so on

Now because the ASCII table can go up to 3 digits long I pad any 1 and 2 digits out so every letter is represented by 3 digits

C=067
Z=090
0-048

The above string then gives me this in a number format:
070067067109102112069102047113057099075081051115106081109048043079103112073112072048081055054108102088101054056053120089111077069061

Now because c# cannot handle big integers I split them down into groups of 17 digits
07006706710910211-20691020471130570-99075081051115106-08110904804307910-31120731120720480-81055054108102088-10105405605312008-9111077069061

(I did add an 8 infront of every group of numbers so that any group that started with 0 retained that 0 when I convert it into a long(int) - I also suffix the last group of numbers with 0s so it is = to 18 digits)

At this point I am able to encrypt, and convert into numbers, add some dashes and reverse it. I could give out the above licence key without too much of a problem.

I did think though that if there was a way for me to simplify this into a group of 12-15 digits and I could run a consistant formula against I would be able to give them a licence key that is far more manageable.

Hope that helps clear it up, but it sounds like I might not be able to do it after all.

A.
 
Many thanks for that,

I am applying that to get the hashed key to begin with but because the source string can contain /, and other odd charactors it produces a hash string as above with +=@, within it.

That is why I am converting to decimal, so it is easier for the user to input. I was hoping to make it even easier by doing some arithmetic, as it would make it more difficuilt to crack.
 
What if you give them an 18 digit number, instead? Assign hashes to say a million 18 digit numbers. Now, when the user enters one of those numbers, your algorithm hashes it and compares to the million hashes the program accepts?
 
ha, I seem to be making this worse :)

Ok,

I start with issuing the user a licence key:

this will be " 18/02/2012,100,tree.local,1,1.01 " (which is [ExpiryDate],[numberusers],[domain],[productid],[version])

my licencing program will then encrypt that using md5 cyprotgrohy and a passphrase and salt and the normal security measures.

This will then give me " CZ0+vBr3QsfgEOz4YOheX6ZElP3oQwrQbcjMC/8y14s= " for exampe.

My licence program then converts each charactor to a ASCII decimal and pads it with 0 to always make it 3 charactors.

This then gives me " 0700670671091021120691020471130570990750810511151060811090480430791031120731120720480810550541081020 88101054056053120089111077069061 "

---------

At this point I am then able to give this to the customer, they type it into the program as the licence key.

The users program then reads this and reverses the above.

So splits the long number into groups of 3, converts that into string which then gives me the hash code. I then build into the program my passphrase etc and I can then have the following

18/02/2012,100,tree.local,1,1.01

this is [ExpiryDate],[numberusers],[domain],[productid],[version].

In my application I can then check individually expiry date, users, domain etc. and make sure they conform with my restrictions.

If it does then great, if not then the licence is expired, or it is being used where it should etc.

------------

Everything is fine with this, all I was trying to do was to find a way of reducing the length of :
070067067109102112069102047113057099075081051115106081109048043079103112073112072048081055054108102088101054056053120089111077069061


so lets say that hypertheically the licence key in my exampe is the above instead it is: - 43204003424 (far too short I know but proves what im trying to accomplish)

There must be a way for me to reverse that into the most simple equation in this case it would be (134^5)

So the licence key would be 134-5

So in my user application rather than converting 43204003424 into groups of 3 and in turn ASCII string etc.

I would first do [a^b] (in my case 134^5) which would then give me 43204003424.

I understand that a simple forumla of a^b will not allow me to get to every number but i was hoping that a forumla was available that would allow me to perform this function.

*** I have been splitting the licence key number down into groups of 18 because c# cannot handle numbers greater than that (or cannot perform math on numbers greater than 18 digits)

So all in all rather than the user inputing 11 digits they have entered 4 and I can still then decode it.

Hope that makes more sense.
 
Top