Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming > Programming Theory

Programming Theory Discuss programming theory, algorithm efficiency, logic, and other any other category where math and computer science overlap.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-2007, 11:31 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default Most Secure Algorithms?

When it comes to encryption, when security is vital, I mean a very important thing, not just a password for your email lol, how do they develop complicated algorithms.. as complicated as it could?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 11-29-2007, 12:27 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,418
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-29-2007, 12:32 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Quote:
Originally Posted by WingedPanther View Post
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.
Like what? like for example inserting an extra 'a' would output like another 10 characters? or what?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-30-2007, 10:37 AM
Maurice_Z Maurice_Z is offline
Learning Programmer
 
Join Date: Nov 2007
Location: Poland
Posts: 35
Rep Power: 4
Maurice_Z is on a distinguished road
Send a message via ICQ to Maurice_Z Send a message via AIM to Maurice_Z Send a message via MSN to Maurice_Z Send a message via Yahoo to Maurice_Z
Default

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
Then I write the character as byte, increase Nochars by one and increase Sumochars by CharacterCode. And so it goes, until all characters are finished.
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
And write results in file. When trying to retrieve the variables, you work backwards:
Code:
desec1score - (sec1score+1)/5-10
desec2score - (sec2score-60)/7+15
desec3score - (sec3score+1)/2
and then compare all results. if they are different, either the code is wrong, or someone tried to alter the variables.
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
desec1score is not equal to score.

I hope I didn't miss the point and said something not according to the topic ^^;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-30-2007, 12:06 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Quote:
Originally Posted by Maurice_Z View Post
I hope I didn't miss the point and said something not according to the topic ^^;
No no man. That is very helpful!

Really thanks for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 11-30-2007, 12:15 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,418
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

Quote:
Originally Posted by TheComputerMaster View Post
Like what? like for example inserting an extra 'a' would output like another 10 characters? or what?
More like inserting an extra 'a' at the end adds a few more chars and radically changes the produced chars around it. Here's an example:

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-30-2007, 02:07 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

That is a drastic change. Thanks for the clear explanation.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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


All times are GMT -5. The time now is 08:58 AM.

Contest Stats

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

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads