clearnax.blogg.se

Passwordsafe to generate password from command line
Passwordsafe to generate password from command line





passwordsafe to generate password from command line

digest end private # Encrypts or decrypts the data with the password hash as key # NOTE: encryption exceptions do not get caught! def crypt ( decrypt_or_encrypt, data, pwhash ) c = OpenSSL :: Cipher. new CIPHER = ' AES256 ' def decrypt ( data, pwhash ) crypt :decrypt, data, pwhash end def encrypt ( data, pwhash ) crypt :encrypt, data, pwhash end def hash ( plaintext ) OpenSSL :: Digest :: SHA512. Require ' openssl ' class PasswordSafe VERSION = ' 0.0.1 '. Let’s modernize and refactor it into a handy, small module:

passwordsafe to generate password from command line

A quick search on the net reveals how to. Let’s dive into it with the most exciting part: Encryption (because it’s an important part). It should be easy to use and especially be useful for every-day-use.It should store many passwords for you, and protect them with a master password.It should be a little command line utility, called pws.What should be the purpose of the program? These are my thoughts The article is divided into four/five phases, each with a code snippet and some explanations about some lines that might not be perspicuous at first glance. So…Īlthough this tutorial is for people who want to learn how to use Ruby, you should be familiar with the Ruby basics. You don’t know, what really happens with your passwords. But lots of them are black boxes, either because they are not open source, or because they have to much features and it gets complicated to understand the source (which is most likely not written in a happy programming language). There are many implementations of password managers/safes out there.







Passwordsafe to generate password from command line