|
Yes, I realize that so I added more information to my original post. It has been a while soince I did maths so I have forgot all the terminology and I am not able to express my problem properly.
|
|
|
|
|
From reading your modified posting, it appears that what you want to preserve is equal ratios for equal distance from the centre (the limits are 1/4 x and 4x relative to the centre), so probably 1/2 x and 2x (i.e. 50 and 200) should also be equal distances from the centre. In this case exponentials are your friend and you should use Luc's solution.
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."
|
|
|
|
|
Hi,
one exponential relation that satisfies your numbers is:
y = 25 * 2 ^ (x/25)
so the inverse formula would be:
x=25*log(y/25)/log(2)
BTW: it does not matter what the base of the log function is (2, e, 10, whatever).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Awesome, that does the job. Thank you!
|
|
|
|
|
Hi,
for this solultion you could check the very good book numerical recipies in c. You can use the fitting algorithm decribed inside.
http://www.nr.com/
Also you can check Math.Net (for .Net)
|
|
|
|
|
If it is only given a small input (one byte) for encryption, and to have to encrypt the input and send it to the receiver through the wireless network then the brute force attack can find my input easily without my encryption. That time what should i do is better for me? Is these any method to decide this problem? I need to keep security for my input and send it to receiver in wireless network. Please help and leave me mail? byambaak@yahoo.com Thank you.
-- modified at 16:03 Wednesday 24th October, 2007
|
|
|
|
|
Bimbaa wrote: If it is only given a small input (one byte) for encryption
Then you should pack it into a full block output, regardless. Most algorithms will output based on block size, not bytes. So a one byte file might still come back as a 16 byte output simply because of the block size.
If you have a single byte and try to output as a single byte, you are already in trouble. If your keys are small such that brute force is fast, you still have a problem. You want long keys and a method of creating a block size output and still restore to original size after decryption.
If it is easy with one byte, chances are your algorithm is also too easy.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Yes output is also too small. I did it and in trouble now. It is coming soon my project time but i did my encryption algorithm input one byte and output two bytes. I saw and read the block algorithm as DES triple DES and AES 128, 192 and 256 bits. I would not like my algorithm to follow the standards as their algorithms do. If i would use block size to the input then my algorithm would be similar with these algorithms. because after choosing block input, it would be request to do rounds, shift and substitute the bytes in the block.If their operations wouldn't in the algorithm means not so good encryption. I have used standard substitution table and a few more characters from standards to my encryption and decryption ready. I know this substitution table supports bytes in block not for one byte. But is it possible to use for only one or two byte? and Is that wrong and it brings me again trouble? I read about that byte substitution table is not easy to created and designed therefore i though about can't create new table one myself and use the standard substitution table to my algorithm that is better for me. If i have a chance to decide without using standard table and creating new one then what chance do i have? I really want to create new crypto for small input number. maybe i have something wrong idea, please tell me correct yours one. I'm happy with a professional is talking with me. Thank you.
|
|
|
|
|
Bimbaa wrote: but i did my encryption algorithm input one byte and output two bytes.
regardless of algorithm, that is too limited on output. I understand the reasoning, it was the same as mine back in the day when I wrote my "living encryption." The idea is good, and you can do a lot, but you can never hope for something that does not leak bits because the output sample is just too small.
I would recommend using a standard if you want to be secure, use someone else's work, not your own. If security doesn't matter and you want to fool around on this, then by all means go for it.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I can expand my input as 16 bytes or more than 16 and encrypt it to output as one block or more than one but after expanding byte, last output of the encryption without substitution, column mix, shift row and Inverse operations is not satisfied for me. Their operations are included in the algorithm that means the algorithm seems to be having similar thing with other standards and maybe it has a lot critiques on the using standards in the encryption from other people. I'm a research student that is why the my project should be in new creation or explorer and it would not be applied for standard. I hope it has a way to decide it, and i can do something new one for encryption and decryption. If you have idea, please share me.
Question1: I hope you have read about substitution table in the AES. If i use it to my encryption algorithm then does it rise any weakness with the encryption after using it.
Question2: what is new protocol is it lately for key exchange protocol? I have the algorithm used Diffie Hellman's key exchanging protocol, which is most known.
Thank you.
|
|
|
|
|
sorry, I won't help with encryption scenarios directly.
Sounds like you know general concepts. But if, as you said, you can break it easily, it is already broken. You should not be able to break your own code by any means other than brute force, and brute force should be measured in as long a time as possible for the significance of the data. After that you can start analyzing the output directly for signs of a good/bad algorithm. After that you always want someone else to look over the idea if it needs to be secure, you are too close to the issue.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Ok Thank you for giving advices. I'm happy with taking answers faster from you even i couldn't decide my problem. If you don't mind, may I keep in touch with you futher by this site?
you are always around this site?
Regards Bimbaa
|
|
|
|
|
It's a public site. Obviously, I can't always help.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Yes that is your right. This is public site. How about by mail? If you have got a mail, which can answer faster, I would like to contact you by mail. If you won't it, you can say "no" directly. i can understand you.
thank you
|
|
|
|
|
Hi Bimbaa,
Bimbaa wrote: If it is only given a small input (one byte) for encryption
Look into padding schemes. For example, RSA uses OAEP. See RSA Algorithm[^].
Bimbaa wrote: brute force attack can find my input easily without my encryption.
Yep. Read up on the attacks... Are you using WEP? From what I recall, it's equivalent to a 40 bit block cipher. It's been a while since I've read into the wireless gear specs and attack vectors.
Jeff
|
|
|
|
|
Hi Jeff. Thank you for advicing to the site.
|
|
|
|
|
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.
|
|
|
|