encryption

Everything else that doesn't fall into one of the other PB categories.
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

encryption

Post by Pantcho!! »

Hello guys, all of my life i see encode here encode there encrypt here encrypt there.

i know what is encryption but i dont know how it works, i noticed PB has few encryption method i would like to use but i dont know how to use excetly and what is the purpose and how to implment it in the best way specially for networking (server key, client key)

could you explain (if you have free time) how necryption works in what ways this is good and bad like your toughts about it and what is the best way to use encryption in server to client type of program.

thank you from advance people 8)
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

If you wanna save passwords, my advice is, don't save the password itself, save a hash of it like the MD5 or DES of the password...

Instead of comparing the password, compare both hashes, the saved one and the one calculated from the typed password.

For example:

Code: Select all

test.s="password"

Debug MD5Fingerprint(@test,Len(test))
If you save the debug result it will be harder to login using the stolen password file, cause you don't know the password itself, you only know how it looks after some kind of maths formula parse it....

You can add extra security, by given it the SALT element, like applying another password to user password, adding or subtrating strings... etc...

More complex encoding does not use the characters but it's ascii value to apply math formulas (normally using prime numbers and/or trig functions) to produce a non sistematic, non repetative outputs (well the output repeats, but usually only after a few millions operations, so it's hard to see and understand the patterns generated)...

Any encriptation is crackable/reversable, but the fact is most of them require so much time to that's not worth it...
Post Reply