|
||||||
| Programming Theory Discuss programming theory, algorithm efficiency, logic, and other any other category where math and computer science overlap. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
| Sponsored Links |
|
|
|
|||||
|
A lot of the secure algorithms aren't very complicated. They ARE resistant to easily determining the input from the output. Most of the algorithms are generated by mathematicians. The most important aspect of a secure algorithm is that a minor change should produce radically different output, making it harder to determine from the encoded object what the source was.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||
|
It could be something like:
every character has a code ranging from 0-255. I have two variables: Nochars - Number of characters Sumochars - sum of the numbers of characters, always being the module of 255. I write the first character as byte, then I increase Nochars by One and Sumochars by the Byte representation of that character (So for example "8" has cahracter code 056 or 38 as Hexademical). After that I look at next character. And I do something like this: Code:
CharacterCode=(Nochars*Sumochars+CharacterCode) Mod 255 This is of course a simple security, but you can easily make it harder by using more mathematical stuff and more complicated mathematical stuff. This thing is good for Securing simple strings, which aren't crucial meaning, but you don't want for example to make player ruin their fun by looking into files. To secure variables, for example to store scores in files, you can do something like this: Code:
score - Score sec1score - (score+10)*5-1 sec2score - (score-15)*7+60 sec3score - score*2-1 Code:
desec1score - (sec1score+1)/5-10 desec2score - (sec2score-60)/7+15 desec3score - (sec3score+1)/2 However you have to keep in mind, that using Dividing while securing might result in fractional parts, which may lead to error, so for your own sake do not divide while Securing(Crypting?). An example of problem: Code:
score=10 sec1score=10/3+1 (Thus it gives 4.333333) desec1score=(4.33333-1)*3=3.33333*3=9.999999 I hope I didn't miss the point and said something not according to the topic ^^; |
|
|||||
|
Quote:
DES encryption: key = '12345678' message1 = 'message' Result1 = '0x67a7087317546139' message2 = 'messagea' Result2 = '0xb126aebf47ea913f' You can look at examples here: Testing DES
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Algorithms - The Basics (PART 2) | TcM | Security Tutorials | 0 | 11-24-2007 11:33 AM |
| Algorithms - The Basics (PART 1) | TcM | Security Tutorials | 0 | 11-24-2007 11:24 AM |
| General: Tutorial, Keep your PC secure for Free! | TcM | Tutorials | 2 | 09-21-2006 01:51 PM |
| Storing a Secure Password | dirkfirst | PHP Forum | 7 | 07-22-2006 11:45 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |