Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,605 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 900 people online right now. Registration is fast and FREE... Join Now!




What is encryption?

2 Pages V  1 2 >  
Reply to this topicStart new topic

What is encryption?

bja888
post 14 Sep, 2005 - 01:06 AM
Post #1


D.I.C Head

Group Icon
Joined: 9 Sep, 2005
Posts: 94


My Contributions


I decided I don't want people who log into my blog to have passwords sent online via a http header. So I made a crude type of encryption. I want to know what real encryption does and how far mine is from the real thing.

Mine...
Takes the string (password). Converts it to its ASCII char code (ie. 117 = u). Then takes the char code and adds it to a array of 8 random numbers 0 to 9. It takes the result of the char code plus random then multilpys it by a nother random number (0 to 9). Then it takes all the numbers and adds them togeather.

Server-side...
Being how its not possable... I do not try to "decrypt" the number vaule. The server "encrypts" the string in the database and checks to see if they match up.
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 14 Sep, 2005 - 05:37 AM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


That is certainly a valid method of encryption. As to if you are close to real encryption, there is no one method of encryption, so your method is valid (although you may not wish to publicize it). While there are many generally accepted standard encyptions and related algorithms, encryption itslef merely refers to disguising the data.

This site provides some good resources for learning about cryptography.
User is offlineProfile CardPM

Go to the top of the page

bja888
post 14 Sep, 2005 - 08:29 AM
Post #3


D.I.C Head

Group Icon
Joined: 9 Sep, 2005
Posts: 94


My Contributions


QUOTE(Amadeus @ Sep 14 2005, 06:37 AM)
(although you may not wish to publicize it).

What's the danger? If you cant decrypt it, why should I worry about other people knowing it?
User is offlineProfile CardPM

Go to the top of the page

Nova Dragoon
post 14 Sep, 2005 - 08:35 AM
Post #4


The Innocent Shall Suffer, Big Time

Group Icon
Joined: 16 Aug, 2001
Posts: 6,128



Thanked 4 times

Dream Kudos: 515

Expert In: Python, Linux

My Contributions


QUOTE(bja888 @ Sep 14 2005, 10:29 AM)
QUOTE(Amadeus @ Sep 14 2005, 06:37 AM)
(although you may not wish to publicize it).

What's the danger? If you cant decrypt it, why should I worry about other people knowing it?

but you can break it, that is a very weak encryption mechanism
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 14 Sep, 2005 - 08:36 AM
Post #5


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


No real danger at all...given what was published...had you inlcuded more information, such as the method you used to generate the random numbers (as such generators are often not random), that might give someone enough to begin work on breaking it...

Just a personal preference, not a rule...
User is offlineProfile CardPM

Go to the top of the page

supersloth
post 14 Sep, 2005 - 08:37 AM
Post #6


serial frotteur

Group Icon
Joined: 21 Mar, 2001
Posts: 19,518



Thanked 11 times

Dream Kudos: 2147483647

Expert In: being gentlemanly

My Contributions


its because telling people how you encrypt information enables users to reverse what you did (de-encryption), and a low-level encryption like what you created is easy to do that too.
User is online!Profile CardPM

Go to the top of the page

Nova Dragoon
post 14 Sep, 2005 - 08:46 AM
Post #7


The Innocent Shall Suffer, Big Time

Group Icon
Joined: 16 Aug, 2001
Posts: 6,128



Thanked 4 times

Dream Kudos: 515

Expert In: Python, Linux

My Contributions


The common encrpytion PKI is public. The way it is secure now is breaking it depends on generating really large prime numbers.

And iirc algorithms to do that either run at very high polynomial time, or probably exponential time. So its is possible to break PKI, it just requires a mad amount of cpu time.


Where as yours would require linear time or small polynomial time, since I assume that you are not generating random number client side, then generating another random number server side, that that random number is common and has to be transfered.
User is offlineProfile CardPM

Go to the top of the page

bja888
post 14 Sep, 2005 - 09:02 AM
Post #8


D.I.C Head

Group Icon
Joined: 9 Sep, 2005
Posts: 94


My Contributions


So it can be decrypted.... Given someone knows how to intercept http requests. Which as far as I know can be done but isnt a real threat.

It's for a blog, not like I will be accepting credit cards through it.
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 14 Sep, 2005 - 09:15 AM
Post #9


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,846



Thanked 45 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


I think you should be just fine. And good on ya for creating something like that!!
User is offlineProfile CardPM

Go to the top of the page

lattyware
post 15 Sep, 2005 - 11:58 AM
Post #10


D.I.C Head

Group Icon
Joined: 8 Aug, 2005
Posts: 55



Dream Kudos: 75
My Contributions


XOR and MD5 - take a look.
User is offlineProfile CardPM

Go to the top of the page

supersloth
post 15 Sep, 2005 - 12:11 PM
Post #11


serial frotteur

Group Icon
Joined: 21 Mar, 2001
Posts: 19,518



Thanked 11 times

Dream Kudos: 2147483647

Expert In: being gentlemanly

My Contributions


XOR is just a mathematical expression for 'AND OR'. it isn't an encryption algorithm like md5.
User is online!Profile CardPM

Go to the top of the page

Nova Dragoon
post 15 Sep, 2005 - 01:27 PM
Post #12


The Innocent Shall Suffer, Big Time

Group Icon
Joined: 16 Aug, 2001
Posts: 6,128



Thanked 4 times

Dream Kudos: 515

Expert In: Python, Linux

My Contributions


QUOTE(supersloth @ Sep 15 2005, 03:08 PM)
XOR is just a mathematical expression for 'AND OR'. it isn't an encryption algorithm like md5.

actually it is both, just really really weak encryption

^ = xor

x^5 = y

y^5 = x


magic!
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 02:28AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month