|
Hello dear reader. I want to know about critique of measurements for cryptography if it has. I did symmetric key encryption and decryption algorithms ready but could not check that encryption and decryption algorithms are satisfied to the real good cryptography or not. Please help me to make sure the algorithms. If someone knows about this prob or to know the person, who are good at the cryptography, please leave me message or contact with me by byambaak@yahoo.com. I really wanna check my encryption decryption algorithms. Thank you.
|
|
|
|
|
The first step is to verify random-ness. You can do this by simply analyzing the output. If the output of any cipher is not near random results for decent amount of text then there is a good chance you are leaking bits. Leaking bits is a term to say that a bit comes through with minimal operatons performed on it and can lead you to the answer by reducng the possibilities.
The next step should be to verify the key is not inferred directly by result. encrypt a text file or large text using one key, and another which is only ONE byte dfference (preferably one bit also). For instance keys: TexasHoldem1 and TexasHoldem2. the two files should have no overlapping characters. If any characters are the same in the same position, it may be chance, but you will want to test again with TexasHoldem3 and TexasHoldem4. If that same byte is not changing, or the byte is changing less oftan than others, again this is an obvious sign you are leaking bits.
Then find a mathematician to help with the final assessment.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Thanks for your answering. That three critiques can satisfy for any cryptography?
If my encryption input is focused on the small numbers as a number inside 1000 then above critiques can satisfy mine? If no,what should i do better to keep my input as security?
I can change and expand my input until as much as i wanted and encrypt it but problem is that simple brute force attack can find my input number easily without find my encrypting.
Is this any method to keep security if input is small. I have necessary to encrypt my input and send it through the network what should i do this time? I have though about that much but have no more good idea to decide the prob. Please help me?
Thank you
|
|
|
|
|
Bimbaa wrote: That three critiques can satisfy for any cryptography?
No, those are the first steps you must do before you pull in the big guns of a mathematician and not waste his time. If you haven't done the initial work, he isn't going to be very happy with you.
As to brute force, you are not worried about brute force, per se. True if your algorithm is so fast that it makes brute force easier that is a problem, but then there are always longer keys. The main thing you are concerned about is leaked key content into the message. One reason we use Triple DES is that DES leaks bits. Re-encrypting it 3 times attempts to hide those bits again. DES was cracked using a non-brute force attack because of a fault in the algorithm.
I have developed several algorithms over the years that satisfied the initial tests, but still failed on the full analysis. One got away and was used for nefarious purposes, luckily for everyone it had a flaw. I have since retired from most cryptography except as entertainment.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
El Corazon wrote: nefarious purposes
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
what is the meaning of barcode
is there really abarcode algorithm
|
|
|
|
|
Google is you best friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I am developing a billing software for a Water Company would someone out there help in the algorithm for calculating the amount to pay based on the logic below am using vb.net.
The Company has set tarrifs which are
Consumption Amount Per Consumption
0-10 12
10-20 33
20-40 44
40-100 56
over 100 64
if a client consumes less than 10 units he pays the minimum which is 120
if a client for Example consumes say 110 units the amount is calculated as follows
0 -10 ten units are used hence amount to pay will be 10*12 =120
100 units will remain
10 -20 ten units are again used hence the amount will be 10*33 =330
total amount will be 120 +330 = 450
90 units remain
20-40 twenty units are used hence amount will be 20 * 44 =880
total amount will be 120+330+880 =1330
70 units remain
40 -100 60 units will be used hence amount will be 60 * 56 =3360
total amount will be 120+330+880+3360=4690
10 units remain
over 100 10 * 64 =640
total amount = 4690 +640 = 5330
briogene
|
|
|
|
|
You've clearly described the algorithm in this post. Now do your own homework.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
Sometimes a person has a mental block, and just has to see someone else's solution before the clouds begin to clear. And then some of it is just experience. When he has been programming as long as I have, solving problems like this will probably be second nature to him. I've worked with programmers for years now, and I see folks struggle with these kinds of (seemingly simple) problems all the time.
Then again, sometimes I struggle with (seemingly simple) problems, and a bit of insight from a coworker is greatly appreciated.
David
|
|
|
|
|
Your algorithm looks suspicious to me. Please verify (just for peace of mind) that the more you use, the more expensive each successive unit is.
I don't work with utilities, and perhaps this is completely correct. It is just counter to my free-market thinking, where, the more you buy, the cheaper each succeding unit is...
static int tarrifAmounts[] = {0, 10, 20, 40, 100, INT_MAX};
static int tarrifRates[] = {0, 12, 33, 44, 56, 64};
int bill( int amount )
{
int ret = 0;
int tindx = 1;
while( amount > tarrifAmounts[tindx] )
{
ret += tarrifRates[tindx] * (tarrifAmounts[tindx]-tarrifAmounts[tindx-1]);
tindx++ ;
}
ret += tarrifRates[tindx] * (amount - tarrifAmounts[tindx-1]);
return ret;
}
Convert it to VB, check whether it works, and send my payment to ...
David
-- modified at 16:54 Monday 22nd October, 2007
OOPS: I just noticed that you said there is a minumum charge. Therefore, the actual billing amount will need to be:
max(MINIMUM_CHARGE, bill(amountUsed))
Or just embed it into the bill algorithm. Whatever works for you.
|
|
|
|
|
Thanks This really works
|
|
|
|
|
|
How handsome does this form need to look, you can do all the math in the push of a button while showing the total bill hours and the total price ONLY or you can break it down into the different levels and show the sub totals of each as you have explained.
I would perform the over 100 math first then deal with everything under 100, in your case 10, 10, 20, 60. The code can be a tad long hand so others can figure it out later in your absence or transfer or move on to a different job, like the boss who may not be an old VB Head. The code can be written after your psuedo code using If Then statements or If Then Else.
Do you already have a form made up, whats on it, I would make it as busy as possible, maybe 7 textboxes, 7 labels, 1 button for the math, but code out each box as in your psuedo code and the button will perform it all and show the TOTAL AMOUNT OWED based on the HOURS CONSUMED.
I just built an excel spreadsheet with the minimum amount of numbers to go from say 23 thru 150, I only used like 7 numbers, like 28 + 36 = 64 or 25 + 32 + 40 = 97, by using these few numbers thru my upper limit I could combine them to get any total from 23 thru 150 inclusive, the maximum of additions would be 5 of my 7 such as 25 + 25 +......= 150.
EDIT, SINCE I LIVE IN A FORIEGN COUNTRY, THE US DOLLAR TO YEN CHANGES DAILY AND WE HAVE CHARTS TO SHOW AT AN INSTANT WHAT YOU WILL GET FOR THE AMOUNT YOU ARE GOING TO EXCHANGE.
I think what I am trying to say is that you should also create a table that will show every combonation from zero (0.01) hours usage thru a FINITE 'n' upper limit or infinite limit, excel will knock that out in seconds for the usage numbers over 100 since the rate does not change over 100.
Are you going to link this all to a spreadsheet or to SQL database, put customer info on form1 and make it busier than I stated above, thats good too.
As you say, you cant see the forest for the trees, this should be an easy one, just depends on how you want it to look and how long do you want the code, even the longest will print out on one sheet of paper.
The more electric you use, the more those people pay, sound like VA disability math being used here.
|
|
|
|
|
So so far I'm trying to implement a class. I can do that alright but I'm having trouble with the methods. I read his algorithm something like this:
1. Let y be the year(such as 1800 or 2001).
2. Divide y by 19 and call the remainder a. Ignore the quotient.
3. Divide y by 100 to get a quotient b and a remainder c.
4. Divide b by 4 to get a quotient d and a remainder e.
5. Divide 8 * b + 13 by 25 to get a quotient g. Ignore the remainder.
6. Divide 19 * a + b - d - g + 15 by 30 to get a remainder h. Ignore the quotient.
7. Divide c by 4 to get a quotient j and a remainder k.
8. Divide a + 11 * h by 319 to get a quotient m. ignore the remainder.
9. Divide 2 * e + 2 * j - k - h + m + 32 by 7 to get remainder r. Ignore the quotient.
10. Divide h - m + r + 90 by 25 to get a quotient n. Ignore the remainder.
11. Divide h - m + r + n + 19 by 32 to get a remainder p. Ignore the quotient.
For the program I input 2001 and it gave me back n=4 and p=17
It's supposed to give back n=4 and p=15.
Here are the equations I wrote:
public int getEasterSundayMonth(int y)
{
double a = y % 19;
int b = (int) y/19;
double c = y % 100;
int d = (int) b/4;
double e = b % 4;
int g = (int) ((8 * b) + 13)/25;
double h = ((19 * a) + b - d - g + 15) % 30;
int j = (int) c/4;
double k = c % 4;
int m = (int) ((a + 11) * h)/319;
double r = ((2 * e) + (2 * j) - k - h + m + 32) % 7;
int n = (int) (h - m + r + 90)/25;
return n;
}
public int getEasterSundayDay(int y)
{
double a = y % 19;
int b = (int) y/19;
double c = y % 100;
int d = (int) b/4;
double e = b % 4;
int g = (int) ((8 * b) + 13)/25;
double h = ((19 * a) + b - d - g + 15) % 30;
int j = (int) c/4;
double k = c % 4;
int m = (int) ((a + 11) * h)/319;
double r = ((2 * e) + (2 * j) - k - h + m + 32) % 7;
int n = (int) (h - m + r + 90)/25;
int p = (int) (h - m + r + n + 19) % 32;
return p;
Please help me find out what's wrong. I kind of don't understand, I do realize that this site is filled more with C and C++, but hopefully you guys can help me out.
|
|
|
|
|
Have you tried debugging it? Single step through the code and check that each line produces what you expect.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Oh hey thanks that helped. I ended up finding out that I wrote:
int b = (int) y/19-when it was supposed to be "y/100."
|
|
|
|
|
I'm looking for some algorithm to help me in plotting large amount of data.
The situation is like this: I have some experimental data points that I want to show in a window, and I want to be able to zoom everywhere in the graph. The data have been recorded for 1 to 2 hours at 10 kHz, so each graph would have 30-70 million points in it.
Of course plotting ALL of the point is way too slow (and quite pointless), so my first -a bit naive- approach to the problem was to plot a point every x, where x depends on the zoom level, eventually plotting each point at very high zoom levels. This works fine but it has a majour problem: these plots, in fact, are not uniform, they have "spikes" that last few milliseconds and I'm interesting in seeing these events at all zoom level (so that I can select that area and zoom into it).
Any idea on how to get around this?
Thanks in advance
nico
|
|
|
|
|
You could try an algorithm that HP used to use in their Spectrum Analyzers. Take whatever range of data you want to plot, say 1 million points, and map this to say 1000 plot points. They would divide the x-axis up into 500 bins of 2000 points each, and in each bin they would determine the max and min value of the 2000 samples. They would then plot the 1000 points min1, max1, min2, max2, min3, max3, ... where {min1, max1} are the min and max values in the first bin etc. If the number of bins you use is greater than the number of pixels across your display then you won't be able to see any difference between the sampled graph and the original one. So visually this looks identical to plotting all the data, but it will plot / update much much faster. Of course if you zoom in significantly you have to recalculate the bins and the max/mins otherwise you will see the sampling artifacts.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
That sounds good! I'll try it, thanks!
nico
|
|
|
|
|
I implemented the solution you suggested and it seems to work really well!
I just have to fine-tune it a little bit for my particular application but it's a very good start!
Thanks a lot!
nico
|
|
|
|
|
You're welcome
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
I like that approach!
ROFLOLMFAO
|
|
|
|
|
|
I saw a PBS show about this very thing over a year ago. I've been wondering how much more advanced we would be right now if that knowledge had passed down through the ages?
|
|
|
|
|