Created
May 9, 2013 05:50
-
-
Save miyamuko/5545801 to your computer and use it in GitHub Desktop.
サービスごとに異なるパスワードを使い分ける方法 for #xyzzy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; http://d.hatena.ne.jp/kazuhooku/20130509/1368071543 | |
(defvar *ore-password-length* 12) | |
(defvar *ore-password-master* nil) | |
(defun ore-password (domain password) | |
(let ((pass (delete #\LFD (si:base64-encode (si:hmac-sha-1 password domain :binary t))))) | |
(if (and *ore-password-length* | |
(< 0 *ore-password-length*)) | |
(substring pass 0 *ore-password-length*) | |
pass))) | |
(defun ore-password-to-clipboard (domain) | |
(interactive "sDomain: ") | |
(unless *ore-password-master* | |
(setf *ore-password-master* (read-string "Master Password: "))) | |
(copy-to-clipboard (ore-password domain *ore-password-master*)) | |
(message "Copy password to clipboard")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment