ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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...
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.