LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-06-2004, 03:43 AM   #1
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 437

Rep: Reputation: 30
Encryption


Hey all

I'm writing a little Password Diary application in C at the moment but am not sure of the best encryption function to use.

Does anyone know of any really good ones?
 
Old 02-06-2004, 04:28 AM   #2
lone_nut
Member
 
Registered: Dec 2003
Location: Denmark
Distribution: Mandrake
Posts: 179

Rep: Reputation: 30
You should [b]NOT[b] use any encryption scheme, that is just made by a programmer. Try to check www.gnupg.com you should find, c programming encryption libraries there. If you can't get them to compile, check that you have install all it requires.
 
Old 02-06-2004, 04:33 AM   #3
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
Encryption is one of those areas where folks who haven't had a lot of experience and coursework give some REALLY bad answers.

First off - there is no such thing as an absolutely uncrackable encryption algorithm with the exception of the OTP algorithm - which is completely impractical to use for encryption. So I'm sure somebody will tell you that such and such encryption can be cracked. And it can - if you let a Cray computer work on it for the next 100 years.

The standard algorithm for what you want is called one-way encryption. Message digest 5 - MD5 is a good one. It is a one-way hash. No matter how long the input string is, the algorithm returns 16 bytes (usually printed in hex). There are other algorithms.

See man md5
 
Old 02-06-2004, 06:38 AM   #4
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 437

Original Poster
Rep: Reputation: 30
Looked at MD5 but for a Password Diary it isn't appropriate for what I need...

What I need is to be able to add the password to the hidden encrypted file, then when it is needed, be able to view the password (by decrypting it obviously)...

I also looked at crypt but I'm unsure of how to decrypt it...
 
Old 02-06-2004, 10:00 AM   #5
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
Two-way encryption (you can decode the encypted message) is what you need. Normally, password files are not meant to be decrypted. linux uses crypt() to hash passwords one-way.

Most of these algorithms requires the use of an extended precision integer library (GNU MP) the algorithms are: RAS, PGP, etc. The math isn't bad, just uses monster numbers.

Here is a pretty good explanation:

http://world.std.com/~franl/crypto/rsa-guts.html
 
Old 02-09-2004, 05:07 AM   #6
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 437

Original Poster
Rep: Reputation: 30
I know password files aren't meant to be decrypted but this is a diary - without encryption it would be a case of would you want everyone being able to see your list of passwords?

All I need to do is encrypt/decrypt the FILE as authentication is met. Unfortunately I feel an experienced programmer could crack this... I have heard that Blowfish would do the job but i'm not sure.

I looked the site you directed me to but I got a bit confused, will try to figure it out when I have some time.
 
Old 02-09-2004, 06:32 AM   #7
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
Tea, blowfish, twofish will work.
 
Old 02-09-2004, 12:53 PM   #8
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 437

Original Poster
Rep: Reputation: 30
Thanks jim - i'll check these out today
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encryption craigs1987 Programming 1 05-01-2005 11:47 PM
Encryption shaf.rahman Red Hat 1 04-19-2005 02:59 PM
encryption dr_zayus69 Linux - Software 2 11-28-2004 11:03 PM
Mandrake 9.0 Wireless Works without encryption.. does not with encryption topcat Linux - Wireless Networking 3 05-04-2003 08:47 PM
Anyone know anything about encryption? BrianK Linux - General 1 07-09-2002 10:55 PM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration