Solved

Create formula from pattern of numbers

Posted on 2009-07-04
51
1,270 Views
Last Modified: 2012-05-07
How can I make a formula from pattern of numbers?
I am programming in vb6. I need to find:
A1, A2, B1, B2 from N=number and C=constant,

Like what would be A1, A2, B1, B2 using N=609011567 and C=18155944

A = (A1 * 256) + A2 = ?
B = (B1 * 256) + B2 = ?

or what would be A1, A2, B1, B2 using N=609011571 and C=18155944

A = (A1 * 256) + A2 = ?
B = (B1 * 256) + B2 = ?

 
Here are the 3. pattern I have:
-------------------------------------------------

1. N=609011568 C=18155944 A1=18 A2=213 B1=125 B2=117

A = (A1 * 256) + A2 = 4821
B = (B1 * 256) + B2 = 32117
-------------------------------------------------

2. N=609011569 C=18155944 A1=211 A2=21 B1=188 B2=181

A = (A1 * 256) + A2 = 54037
B = (B1 * 256) + B2 = 48309
-------------------------------------------------

3. N=609011570 C=18155944 A1=147 A2=20 B1=252 B2=180

A = (A1 * 256) + A2 = 37652
B = (B1 * 256) + B2 = 64692
-------------------------------------------------

Is this possible from known data or is more needed?
0
Comment
Question by:iscode
  • 23
  • 10
  • 8
  • +2
51 Comments
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
Hi

Just looking at it, could be written as a set of simultaneous equations y = mx + b.  Where the three equations intersect at some point on the graph.  

The slope of the line is m, which in this case could be 256.    

You have the constant C = 18155944 in each and the N in equation one is N + 1 in equation two and N + 2 in equation three.

And some more work.

This will help as a start.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Hi uucknaaa and thanks for the reply

I am not quite following your explaining :-) can you show me with an sample from the data I show?

The program read the N number like in 1.st. sample as 609011568 possibly using the C number in the calculation
possibly using hex or ascii value and gets A1, A2, B1 and B2 to make the result with
A1=18 A2=213 B1=125 B2=117
A = (A1 * 256) + A2 = 4821
B = (B1 * 256) + B2 = 32117
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
OK ..

There is probably a much easier way to do this, but I just notice from the data given in each of the three cases, that the mathematical formula is y = mx + b.  Where x and y would be the x and y axis, with m being the slope and b being a constant.

To illustrate, and it is just to illustrate, I entered the information in each equation form and built a table.  The table is attached.  If we use the N to equal y and the constant to equal b then with 256 as m or x in the equation, look at the data.

It is interesting to note that if we solve for the unknown in each set of equations, we come up with the same number (or pretty close).

Now that's about the best I can explain it.  We probably need another expert to take a look at it.
Picture-3.png
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Hi
Ok I see this a bit more clear, but doesnt this just tell us there is a pattern in this like a step in a stair or the straight slope line in the stair?

First for me to understand this formula y=mx+b is to see how it work from each angle
so from what we know is:
b= 18155944
m=256
x=?
y=609011568
Can you show me with sample how did you get the x?
and how would you find y, b or m ?
I mean in plain math not algebra :-) because I want ot make a test code to have those fields b, m, x, y and get the result from the input using the formula needed for each.
 
0
 
LVL 14

Accepted Solution

by:
uucknaaa earned 250 total points
Comment Utility
Yes ..

So

x = (y-b) / m = 2308029.79

and m = (y-b) / x

and b = y - (m*x)

and y = (m*x) + b

On the issue of plain math, I built the above table in Excel.

Let me know if anything is missing.  This sure is interesting.

0
 
LVL 6

Author Comment

by:iscode
Comment Utility

Yes this is interesting...
We need first to find:
x1 and b1 in relation with 609011567 and 18155944 and we know m1=256
x2 and b2 in relation with 609011567 and 18155944 and we know m2=256

we know the pattern for
609011568 is:
x1=18 b1=213
x2=125 b2=117
and
609011569 is:
x1=211 b1=21
x2=188 b2=181
and
609011570 is:
x1=147 b1=20
x2=252 b2=180



0
 
LVL 6

Author Comment

by:iscode
Comment Utility

I forgot to say in the test I did with the pattern using:
x = (y - b) / m  
and subtract the result between
I always got the same number
0,00390625
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
Using the x = (y - b) / m should give the same answer 2308029.79 using the data that is available.

Is that not right?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Using:
609011568 = 2308029,78125
609011569 = 2308029,78515625
609011570 = 2308029,7890625

and if you subtract 2 numbers give you always = 0,00390625 different
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
Yes .. coming from the different values for y.  Interesting.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
What I find interesting with this number is
0.390625 = (100/256)

do you think its a glue?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
sorry I should reather say
0,00390625 = (1/256)

do you think its a clue? ha
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
aaaaaaaa ....

2 * 2 * 2 * 2 * 2 * 2 * 2 * 2  

ha ha .. ha

0
 
LVL 6

Author Comment

by:iscode
Comment Utility
I really need some idea to solve this
0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
What are you doing?

Some kind of hash table?  Or a password/security algorithm?

Where do you get the values like    N=609011567 and C=18155944  ??

Why does N seem to increment while C seems to be fixed?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Hi d-glitch

I am working on password algorithm,

N=609011567 is the serial number of the hard disk and C=18155944 is a constant.

N increment by one by me, for testing to see the pattern when I change the serial number in
hard disk by 1.


0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
If you are trying to crack a password/security algorithm, we aren't allowed to help.

0
 
LVL 6

Author Comment

by:iscode
Comment Utility
I am working on this for my own programs to study different ways of encryptions.
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
iscode,

Why didn't you say you were working on a password encryption algorithm right up front?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Yes why dont I just yell out hey I am making a password algorithm, come and see how I will do it !!!
Well because its sentimental topic and you dont want to release that up front do you?

But if I am asked like d-glitch did I dont mind giving that information to hep in the topic to get better understanding but really you dont just call it out.

Like my question is:
I am studying the patterns in numbers and how easy it is to read in the pattern to make my programs more secure.

I am not looking for help on cracking others people software because I showed the result in the formulas I am giving.
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
Sorry about that.  I just didn't want to get into any trouble here, so i thought I'd ask.

Didn't mean to cause any problems.  Let's just go back to what we were working on.

What to you think needs to be done at this point?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
uucknaaa

No need to feel sorry  no problem done,
the only troubles we will get here is with those numbers :-)

I really need ideas
0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
You have one or more inputs:  What are they?

You have one or more outputs:  What are they?

You have (or are trying to develop) a function or algorithm that will ..... ?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
d-glitch

Did you bother to read my question and details for this topic?
It should answer all your questions.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Expert Comment

by:Jack020800
Comment Utility
Hi iscode!
Although through your description of the problem you trying to confuse the reader,  the actual problem seem to be very easy and related to simultaneous equations only.
can you provide the problem in clear language excluding all unwanted jargons ,it doesnt matter you doing it for some algoritham or thinking to crack your neighbour's door.
It should provide here with just what input it takes for your problem and what output you except.
You saying you thinking to develop the formula from the pattern of it.
You say you got the set of N=Constant equations and if you have C=Constant, it doesnt seem to be in picture.
The format for the imultaneous equations is y = mx + C
where 'm' is the slope of the line , represented as differential of 'y' wrt 'x' as dy/dx=m
and 'c' is the constant ,represented as a intercept  of the line.
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
Jack,

Thanks.  Exactly my thoughts.  

iscode,

And even if we just go from where we are, what are the specific issues/help/trouble with the numbers?  I'm assuming the numbers you are referring to are the solutions to the simultaneous equations with the variance arising from the N (or y) number.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Hi

Jack
My intention is not to confuse the reader in anyway.
Like my question say's "How do you create formula from patterns of numbers" and I give an sample with the patterns.  I am studying how you read the pattern and get defined result.
Pattern means we have input as numer like N and it is a loop of N +1 and we have a result of A1=? A2=?
I am using a loop so we can create the pattern or like uucknaaa pointed out a simultaneous equations.

uucknaaa
>>specific issues/help/trouble with the numbers?<<
When we know the pattern = input and output how do we solve the engine that produced the pattern.

I got this idea from a question I saw on Dr.Math about patterns in numbers.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
0
 
LVL 6

Author Comment

by:iscode
Comment Utility

How do I figure out the next numbers in the pattern for 1 and 5
1) A1=?   A2=?   B1=?   B2=?
2) A1=18  A2=213 B1=125 B2=117
3) A1=211 A2=21  B1=188 B2=181
4) A1=147 A2=20  B1=252 B2=180
5) A1=?   A2=?   B1=?   B2=?

Is this more clear?
0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
Now how do N=609011567 and C=18155944 come into things?
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
N is the input for each number 1. 2. 3. 4. 5. and we know 2. 3. 4. and we want to find 1. and 5. right?

1. N=609011567 C=18155944 A1=?    A2=?     B1=?     B2=?
2. N=609011568 C=18155944 A1=18  A2=213 B1=125 B2=117
3. N=609011569 C=18155944 A1=211 A2=21  B1=188 B2=181
4. N=609011570 C=18155944 A1=147 A2=20  B1=252 B2=180
5. N=609011571 C=18155944 A1=?    A2=?     B1=?     B2=?
0
 
LVL 27

Assisted Solution

by:d-glitch
d-glitch earned 250 total points
Comment Utility

For A1:
 

1.   80 + 194 = 274 ==>  18

2.   18 + 193 = 211

3.  211 + 192 = 403 ==> 147

4.  147 + 191 = 338 ==>  82

5.   82 + 192 = ...
 

For B1:
 

1.   63 + 62 = 125 

2.  125 + 63 = 188

3.  188 + 64 = 252 

4.  252 + 65 = 317 ==>  61

5.   61 + 66 = ...

Open in new window

0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
Just to be clear:  The arithmetic in my last post was mod 256.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
d-glitch
Finaly we are talking same language,
it didnt take you long when you started :-)
did you look into A2 and be B2?
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
It will be much easier and safer if you base your result on a hash (SHA160 or SHA256) of the volser and some other information.

In the end, you will only be as safe as your code is protected.  I suggest you obfuscate your application in such critical/sensitive areas.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
aikimark
Thanks for that point,
I have not looked much into SHA160 or SHA256 yet, isnt it similar to MD5?
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
yes.  It is similar to MD5.  Although you haven't told us enough details, I would guess that 'password algorithm' is similar to the licensing scheme in one of my commercial applications.  Since there has been some successful attacking of MD5 and NIST has stated that it should not be used for sensitive (government) applications, I chose to use one of the SHA algorithms instead.

===========
We can help you if you use some different data as your example than what you will actually use in your production code.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
aikimark
I will have that in mind thank you

but right now I am just trying to gain some understanding and look at numbers in a different way
through the patterns, I work alot with formula for different control systems through serialport and
this can give me different aspect of the data and help my poor math skill.
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
do you need a secure handshake mechanism?  You can still do this with password hashing.

Typical scenario...client asks to connect, server sends some data (number/string), the data is used as a salt to the hash of the password which is then hashed and sent to the server, the server repeats the process using the password hash stored on the server, these two hashes are compared.

=================
Your latest post does not seem to be connected with your question.  Please supply us with these details.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
I am not looking at hashing security right now I dont know so much about it yet but will sure look at it

My last post was ment to specially point you at the topic here and my question related that is to:
Look at numbers in a different view then I have before and it interest me to see the logic behind the
patterns number gives us. At least it helps me alot to gain uderstaning in my day problems.
So look again and tell me how is that not connected my question?
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
"different control systems through serialport" is not explicitly related to discernment of pattern of numbers.  

You have introduced both multiple items/objects you call "control systems" and specific communications channel "serialport".

===============
Something is starting to smell a little 'fishy' with this discussion.  I'm not buying the need for secrecy and now we are introduced to two new aspects of your question's actual application(s).  I'm not saying something is 'wrong', but I'm reminded of this xkcd cartoon:
http://xkcd.com/463/
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
Haha you are a funny guy and I sure dont get offended of your attitude
and I dont really care what you read into my plain engish

But for the record:
I was giving you an example of how I deal with numbers in many ways in day problems one of them is serial port communication but its really noon of your bussines what I am doing and I come here to try to gain more knowlage from experts specially about math and my question is not just related to security its a general math question.
0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
The coding sequence I proposed for A1 and B1 is simple and it certainly works.
But notice that it doesn't make any use of N or C.
There are an infinite number of ways to come up with a sequence that does.
And I do mean "infinite,"  not just "many."

The coding sequence used for A2/B2 may be more complex.
It appears that the same coding sequence may be used for both values.
But with so little data, it would be foolish even to guess what it might be.

Even if you were to provide more data, I would not be willing to analyze it.

The sole purpose of this post is to suggest that what you are doing is a waste
of time.
0
 
LVL 6

Author Comment

by:iscode
Comment Utility
The main purpose of the question was to see how we read into patterns after I
read dr.math link and I wanted to see how we can avoid too obvious pattern in formulas
specially related to security and this tells me even though we have patterns
it does not mean its tracked back so easy and thats good news.

My second purpos was to see the work of the programmer to find the clues and
how he analyze the data so I can have that in mind when making securety for my own programs.

I have noticed this is very fragile topic on forums and people jump to conclusion
very fast when this topic is fronted and start to analyze the questioner and
take this to different areas but dont we do that too often in daily life we judge
and make comments before we have the whole picture.

Because of comments from aikimark I see me forced to point this out though I never
like to have to justify what I am doing:

If aikimark wants to analyse something its always a good start to look at history.
I will give him a clue because he got so thrilled about my comment on serialport related to math.

My latest questions history on EE is:

1. Question: Webserver receiving temperature value. Deleted, I solved it my self.
(Related to input from serialport with Temperature Sensor and display on Webserver.)

2. Question: Draw grid map in Visual Basic 6
(Related to Maps and input from serialport with GPS)
This question even is now in 3.rd plase in Top solution on EE: Visual Basic Programming.
Hope it means something good :-)

3. Question: Sun and Moon position.
(Related to Math and Maps)


Conclusion to my question is No answer from experts,
I have the solution myself so I will request it to be deleted.
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
I object to the delete request. (see below)
__________________
"The main purpose of the question was to see how we read into patterns after I read dr.math link and I wanted to see how we can avoid too obvious pattern in formulas specially related to security and this tells me even though we have patterns it does not mean its tracked back so easy and thats good news."

That was not made clear in your question.  The comments you received were clearly addressed to the question you asked...at least our interpretation of your question and its intent.
___________________
"My second purpos was to see the work of the programmer to find the clues and how he analyze the data so I can have that in mind when making securety for my own programs."

You have seen part of that analysis in the comments from uucknaaa and d-glitch.  You got what you asked for.
___________________
"Conclusion to my question is No answer from experts,
I have the solution myself so I will request it to be deleted."

Your intent was to have us do a numerical, quasi-cryptanalysis, of some sequences.  In that respect, these two experts supplied that.  You didn't help us by
* posting a poorly crafted question
* adding information that was not helpful, in fact distracting, to the experts working on the question
* hiding behind some veiled need secrecy when asked about details and context.
___________________
My object to your deletion request comes after reviewing your question and the underlying intent you just posted (#24815233).  

I also looked at your prior questions you referenced.

My review does not change my decision to object to your deletion request.
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
Accept the following:
http://#24780412
http://#24807250
0
 
LVL 27

Expert Comment

by:d-glitch
Comment Utility
I agree with aikimark.
0
 
LVL 14

Expert Comment

by:uucknaaa
Comment Utility
d-glitch has it right.  As a new user, I appreciate the guidance from all.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now