gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

simple-passwd-gen.el


From: Uwe Brauer
Subject: simple-passwd-gen.el
Date: Wed, 22 Jan 2014 15:17:50 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) XEmacs/21.5-b33 (linux)

Hello

This is a very simple lisp function for generating secure passwords.

 Based on an idea published by Eike Kiltz in 
 
http://www.spiegel.de/netzwelt/gadgets/logins-mit-diesen-tricks-behalten-it-experten-ihr-passwort-a-937647.html
 
 The idea is the following.
 a master passwd (which should be sufficiently `exotic' is set, for general 
purpose.
 a  specific passwd suffix is given
 then a new passwd is generated, using the resulting string 
 applying  the sha1 hash function in binary format 
 applying base64 
 truncating the resulting string to 10 chars.
 Example: master passwd `MASTER' and passwd suffix `Spiegel'
 would give `6b31GV19s4'.

;;; simple-passwd-gen.el --- Simple generator of a password based on `sha1' and 
`base64'

;; Copyright (C) 2014 Uwe Brauer

;; Author: Uwe Brauer address@hidden
;; Maintainer: Uwe Brauer address@hidden
;; Created: 22 Jan 2014
;; Version: 1.0
;; Keywords:

 
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 1, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; A copy of the GNU General Public License can be obtained from this
;; program's author (send electronic mail to address@hidden) or from
;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
;; 02139, USA.

;; LCD Archive Entry:
;; simple-passwd-gen|Uwe Brauer|address@hidden
;; |
;; |$Date: 2014/01/22 14:01:33 $|$Revision: 1.1 
$|~/packages/simple-passwd-gen.el

;;; Commentary:

;; Based on an idea published by Eike Kiltz in 
;; 
http://www.spiegel.de/netzwelt/gadgets/logins-mit-diesen-tricks-behalten-it-experten-ihr-passwort-a-937647.html
;; 
;; The idea is the following.
;; A master passwd (which should be sufficiently `exotic' is set, for general 
purpose.
;; A  specific passwd suffix is given
;; then a new passwd is generated, using the resulting string 
;; applying  the sha1 hash function in binary format 
;; applying base64 
;; truncating the resulting string to 10 chars.
;; Example: master passwd `MASTER' and passwd suffix `Spiegel'
;; would give `6b31GV19s4'.


;;; Change log:
;; $Log: simple-passwd-gen.el,v $
;; Revision 1.1  2014/01/22 14:01:33  oub
;; Initial revision
;;

;;; Code:

(defconst simple-passwd-gen-version (concat "0." (substring "$Revision: 1.1 $" 
13 14))
        "$Id: simple-passwd-gen.el,v 1.1 2014/01/22 14:01:33 oub Exp oub $
Report bugs to: Uwe Brauer address@hidden")


;; Variables
(defvar simple-passwd-generator-master-passwd "MASTER" 
 "*Master Password which is the `prefix' for the password,
 which will be later generated. Should be an `exotic' string.")

(defvar simple-passwd-generator-trunc-number 10
 "*Width to which  the passwd should be truncated, default is 10.")


(defun simple-passwd-generator (passwdinput)
  "Simple generator of a password based on `sha1' and `base64'. 
`Lisp' implimentation."
  (interactive "sType your passwd input: ")
  (let* ((passwdin 
                  (concat simple-passwd-generator-master-passwd " " 
passwdinput))
                 (convert (base64-encode-string (sha1-binary passwdin)))
                 (short (truncate-string-to-width (format "%s" convert) 
simple-passwd-generator-trunc-number)))
        (insert short))) 



(provide 'simple-passwd-gen)
;;; mygenpass.el ends here

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]