├── LICENSE ├── README.md └── password-generator.el /LICENSE: -------------------------------------------------------------------------------- 1 | The Artistic License 2.0 2 | 3 | Copyright (c) 2015 zargener 4 | 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | This license establishes the terms under which a given free software 11 | Package may be copied, modified, distributed, and/or redistributed. 12 | The intent is that the Copyright Holder maintains some artistic 13 | control over the development of that Package while still keeping the 14 | Package available as open source and free software. 15 | 16 | You are always permitted to make arrangements wholly outside of this 17 | license directly with the Copyright Holder of a given Package. If the 18 | terms of this license do not permit the full use that you propose to 19 | make of the Package, you should contact the Copyright Holder and seek 20 | a different licensing arrangement. 21 | 22 | Definitions 23 | 24 | "Copyright Holder" means the individual(s) or organization(s) 25 | named in the copyright notice for the entire Package. 26 | 27 | "Contributor" means any party that has contributed code or other 28 | material to the Package, in accordance with the Copyright Holder's 29 | procedures. 30 | 31 | "You" and "your" means any person who would like to copy, 32 | distribute, or modify the Package. 33 | 34 | "Package" means the collection of files distributed by the 35 | Copyright Holder, and derivatives of that collection and/or of 36 | those files. A given Package may consist of either the Standard 37 | Version, or a Modified Version. 38 | 39 | "Distribute" means providing a copy of the Package or making it 40 | accessible to anyone else, or in the case of a company or 41 | organization, to others outside of your company or organization. 42 | 43 | "Distributor Fee" means any fee that you charge for Distributing 44 | this Package or providing support for this Package to another 45 | party. It does not mean licensing fees. 46 | 47 | "Standard Version" refers to the Package if it has not been 48 | modified, or has been modified only in ways explicitly requested 49 | by the Copyright Holder. 50 | 51 | "Modified Version" means the Package, if it has been changed, and 52 | such changes were not explicitly requested by the Copyright 53 | Holder. 54 | 55 | "Original License" means this Artistic License as Distributed with 56 | the Standard Version of the Package, in its current version or as 57 | it may be modified by The Perl Foundation in the future. 58 | 59 | "Source" form means the source code, documentation source, and 60 | configuration files for the Package. 61 | 62 | "Compiled" form means the compiled bytecode, object code, binary, 63 | or any other form resulting from mechanical transformation or 64 | translation of the Source form. 65 | 66 | 67 | Permission for Use and Modification Without Distribution 68 | 69 | (1) You are permitted to use the Standard Version and create and use 70 | Modified Versions for any purpose without restriction, provided that 71 | you do not Distribute the Modified Version. 72 | 73 | 74 | Permissions for Redistribution of the Standard Version 75 | 76 | (2) You may Distribute verbatim copies of the Source form of the 77 | Standard Version of this Package in any medium without restriction, 78 | either gratis or for a Distributor Fee, provided that you duplicate 79 | all of the original copyright notices and associated disclaimers. At 80 | your discretion, such verbatim copies may or may not include a 81 | Compiled form of the Package. 82 | 83 | (3) You may apply any bug fixes, portability changes, and other 84 | modifications made available from the Copyright Holder. The resulting 85 | Package will still be considered the Standard Version, and as such 86 | will be subject to the Original License. 87 | 88 | 89 | Distribution of Modified Versions of the Package as Source 90 | 91 | (4) You may Distribute your Modified Version as Source (either gratis 92 | or for a Distributor Fee, and with or without a Compiled form of the 93 | Modified Version) provided that you clearly document how it differs 94 | from the Standard Version, including, but not limited to, documenting 95 | any non-standard features, executables, or modules, and provided that 96 | you do at least ONE of the following: 97 | 98 | (a) make the Modified Version available to the Copyright Holder 99 | of the Standard Version, under the Original License, so that the 100 | Copyright Holder may include your modifications in the Standard 101 | Version. 102 | 103 | (b) ensure that installation of your Modified Version does not 104 | prevent the user installing or running the Standard Version. In 105 | addition, the Modified Version must bear a name that is different 106 | from the name of the Standard Version. 107 | 108 | (c) allow anyone who receives a copy of the Modified Version to 109 | make the Source form of the Modified Version available to others 110 | under 111 | 112 | (i) the Original License or 113 | 114 | (ii) a license that permits the licensee to freely copy, 115 | modify and redistribute the Modified Version using the same 116 | licensing terms that apply to the copy that the licensee 117 | received, and requires that the Source form of the Modified 118 | Version, and of any works derived from it, be made freely 119 | available in that license fees are prohibited but Distributor 120 | Fees are allowed. 121 | 122 | 123 | Distribution of Compiled Forms of the Standard Version 124 | or Modified Versions without the Source 125 | 126 | (5) You may Distribute Compiled forms of the Standard Version without 127 | the Source, provided that you include complete instructions on how to 128 | get the Source of the Standard Version. Such instructions must be 129 | valid at the time of your distribution. If these instructions, at any 130 | time while you are carrying out such distribution, become invalid, you 131 | must provide new instructions on demand or cease further distribution. 132 | If you provide valid instructions or cease distribution within thirty 133 | days after you become aware that the instructions are invalid, then 134 | you do not forfeit any of your rights under this license. 135 | 136 | (6) You may Distribute a Modified Version in Compiled form without 137 | the Source, provided that you comply with Section 4 with respect to 138 | the Source of the Modified Version. 139 | 140 | 141 | Aggregating or Linking the Package 142 | 143 | (7) You may aggregate the Package (either the Standard Version or 144 | Modified Version) with other packages and Distribute the resulting 145 | aggregation provided that you do not charge a licensing fee for the 146 | Package. Distributor Fees are permitted, and licensing fees for other 147 | components in the aggregation are permitted. The terms of this license 148 | apply to the use and Distribution of the Standard or Modified Versions 149 | as included in the aggregation. 150 | 151 | (8) You are permitted to link Modified and Standard Versions with 152 | other works, to embed the Package in a larger work of your own, or to 153 | build stand-alone binary or bytecode versions of applications that 154 | include the Package, and Distribute the result without restriction, 155 | provided the result does not expose a direct interface to the Package. 156 | 157 | 158 | Items That are Not Considered Part of a Modified Version 159 | 160 | (9) Works (including, but not limited to, modules and scripts) that 161 | merely extend or make use of the Package, do not, by themselves, cause 162 | the Package to be a Modified Version. In addition, such works are not 163 | considered parts of the Package itself, and are not subject to the 164 | terms of this license. 165 | 166 | 167 | General Provisions 168 | 169 | (10) Any use, modification, and distribution of the Standard or 170 | Modified Versions is governed by this Artistic License. By using, 171 | modifying or distributing the Package, you accept this license. Do not 172 | use, modify, or distribute the Package, if you do not accept this 173 | license. 174 | 175 | (11) If your Modified Version has been derived from a Modified 176 | Version made by someone other than you, you are nevertheless required 177 | to ensure that your Modified Version complies with the requirements of 178 | this license. 179 | 180 | (12) This license does not grant you the right to use any trademark, 181 | service mark, tradename, or logo of the Copyright Holder. 182 | 183 | (13) This license includes the non-exclusive, worldwide, 184 | free-of-charge patent license to make, have made, use, offer to sell, 185 | sell, import and otherwise transfer the Package with respect to any 186 | patent claims licensable by the Copyright Holder that are necessarily 187 | infringed by the Package. If you institute patent litigation 188 | (including a cross-claim or counterclaim) against any party alleging 189 | that the Package constitutes direct or contributory patent 190 | infringement, then this Artistic License to you shall terminate on the 191 | date that such litigation is filed. 192 | 193 | (14) Disclaimer of Warranty: 194 | THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS 195 | IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED 196 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 197 | NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL 198 | LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL 199 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 200 | DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF 201 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # emacs-password-genarator 2 | 3 | ## Generate passwords inside Emacs 4 | 5 | This package provides simple functions to create passwords and insert them inside buffer immediately. I've tried to cover most common cases of passwords. 6 | 7 | ## Simple usage: 8 | 9 | `M-x password-generator-simple` - generate 8 characters password valid for almost all websites. Like: `J9l1Ekw2` 10 | 11 | `M-x password-generator-strong` - generate 12 characters password with some special characters. THis type of password is valid for most of websites, and also will not hurt you if you will pass it to via shell script or so. Like: `DSSAxnF@SyL,` 12 | 13 | `M-x password-generator-paranoid` - generate 20 characters password for paranoids, who does not afraid of those create-password-with-specaial-characters-no-dumbass-not-that-special-characters! sites. Like: `y2%c74r>_2cLgGC,$Q)_` 14 | 15 | `M-x password-generator-phonetic` - generate 8 characters password, which most of us can simply remember. Like: `pa4zi3go` or `za3hi2de` or `ke5ho7pe` 16 | 17 | `M-x password-generator-numeric` - generate 4 digits password. 18 | 19 | `M-x password-generator-words` - generate password from 4 random of most used 1500 english words. "." is default separator. 20 | 21 | `M-x password-generator-custom` - generate password your alphabet. 22 | 23 | 24 | ## Changing password length: 25 | 26 | `C-u 10 M-x password-generator-numeric` - generate 10 digits password. 27 | `C-u 32 M-x password-generator-paranoid` - generate 32 characters password with specil symbols. 28 | 29 | etc. 30 | 31 | `C-u 5 M-x password-generator-words` - generate password from 5 random words, but exact length is unpredicatble! 32 | 33 | 34 | ## Customizing the package: 35 | 36 | See `M-x customize-group` for group password-generator . 37 | 38 | 39 | ## Generate password but not to insert it: 40 | 41 | `(password-generator-strong 10 t)` - will return 10 characters length password. 42 | 43 | 44 | ## Generate passwords from your own alphabet: 45 | 46 | `password-generator-custom` is used for generating passwords which is phone friendly, or containing symbols from your national language. To define its behavior customize variables `password-generator-custom-length` and `password-generator-custom-alphabet`. 47 | 48 | 49 | ### Please star the repo if you find this package useful! 50 | 51 | Thank you for using this software. 52 | -------------------------------------------------------------------------------- /password-generator.el: -------------------------------------------------------------------------------- 1 | ;;; password-generator.el --- Password generator for humans. Good, Bad, Phonetic passwords included. 2 | 3 | ;; Copyright (C) 2021 4 | 5 | ;; Author: Vandrlexay 6 | ;; URL: http://github.com/vandrlexay/emacs-password-genarator 7 | ;; Version: 1.20 8 | 9 | ;;; Commentary: 10 | 11 | ;; Generate a password and insert it in-place. Such functions provided: 12 | 13 | ;; password-generator-numeric - generate PIN-code or any other numeric password. 14 | ;; password-generator-simple - simple password for most websites. 15 | ;; password-generator-phonetic - easy to remember password. 16 | ;; password-generator-strong - strong password and still suitable for most web sites with strange password requirements to used special chars. 17 | ;; password-generator-words - generate rememberable password from top used 1500 english words. 18 | ;; password-generator-custom - generate custome password from your alphabete. 19 | 20 | ;; Use C-u password-generator-simple to specify length of generated password. This works with other functions too. 21 | 22 | ;; See full docs here: http://github.com/vandrlexay/emacs-password-genarator 23 | 24 | ;;; Code: 25 | 26 | (defgroup password-generator nil "Password generator for Emacs" :group 'applications) 27 | 28 | (defcustom password-generator-vocabulary-nouns '("people" "history" "way" "art" "world" "information" "map" "two" "family" "government" "health" "system" "computer" "meat" "year" "thanks" "music" "person" "reading" "method" "data" "food" "understanding" "theory" "law" "bird" "literature" "problem" "software" "control" "knowledge" "power" "ability" "economics" "love" "internet" "television" "science" "library" "nature" "fact" "product" "idea" "temperature" "investment" "area" "society" "activity" "story" "industry" "media" "thing" "oven" "community" "definition" "safety" "quality" "development" "language" "management" "player" "variety" "video" "week" "security" "country" "exam" "movie" "organization" "equipment" "physics" "analysis" "policy" "series" "thought" "basis" "boyfriend" "direction" "strategy" "technology" "army" "camera" "freedom" "paper" "environment" "child" "instance" "month" "truth" "marketing" "university" "writing" "article" "department" "difference" "goal" "news" "audience" "fishing" "growth" "income" "marriage" "user" "combination" "failure" "meaning" "medicine" "philosophy" "teacher" "communication" "night" "chemistry" "disease" "disk" "energy" "nation" "road" "role" "soup" "advertising" "location" "success" "addition" "apartment" "education" "math" "moment" "painting" "politics" "attention" "decision" "event" "property" "shopping" "student" "wood" "competition" "distribution" "entertainment" "office" "population" "president" "unit" "category" "cigarette" "context" "introduction" "opportunity" "performance" "driver" "flight" "length" "magazine" "newspaper" "relationship" "teaching" "cell" "dealer" "finding" "lake" "member" "message" "phone" "scene" "appearance" "association" "concept" "customer" "death" "discussion" "housing" "inflation" "insurance" "mood" "woman" "advice" "blood" "effort" "expression" "importance" "opinion" "payment" "reality" "responsibility" "situation" "skill" "statement" "wealth" "application" "city" "county" "depth" "estate" "foundation" "grandmother" "heart" "perspective" "photo" "recipe" "studio" "topic" "collection" "depression" "imagination" "passion" "percentage" "resource" "setting" "ad" "agency" "college" "connection" "criticism" "debt" "description" "memory" "patience" "secretary" "solution" "administration" "aspect" "attitude" "director" "personality" "psychology" "recommendation" "response" "selection" "storage" "version" "alcohol" "argument" "complaint" "contract" "emphasis" "highway" "loss" "membership" "possession" "preparation" "steak" "union" "agreement" "cancer" "currency" "employment" "engineering" "entry" "interaction" "mixture" "preference" "region" "republic" "tradition" "virus" "actor" "classroom" "delivery" "device" "difficulty" "drama" "election" "engine" "football" "guidance" "hotel" "owner" "priority" "protection" "suggestion" "tension" "variation" "anxiety" "atmosphere" "awareness" "bath" "bread" "candidate" "climate" "comparison" "confusion" "construction" "elevator" "emotion" "employee" "employer" "guest" "height" "leadership" "mall" "manager" "operation" "recording" "sample" "transportation" "charity" "cousin" "disaster" "editor" "efficiency" "excitement" "extent" "feedback" "guitar" "homework" "leader" "mom" "outcome" "permission" "presentation" "promotion" "reflection" "refrigerator" "resolution" "revenue" "session" "singer" "tennis" "basket" "bonus" "cabinet" "childhood" "church" "clothes" "coffee" "dinner" "drawing" "hair" "hearing" "initiative" "judgment" "lab" "measurement" "mode" "mud" "orange" "poetry" "police" "possibility" "procedure" "queen" "ratio" "relation" "restaurant" "satisfaction" "sector" "signature" "significance" "song" "tooth" "town" "vehicle" "volume" "wife" "accident" "airport" "appointment" "arrival" "assumption" "baseball" "chapter" "committee" "conversation" "database" "enthusiasm" "error" "explanation" "farmer" "gate" "girl" "hall" "historian" "hospital" "injury" "instruction" "maintenance" "manufacturer" "meal" "perception" "pie" "poem" "presence" "proposal" "reception" "replacement" "revolution" "river" "son" "speech" "tea" "village" "warning" "winner" "worker" "writer" "assistance" "breath" "buyer" "chest" "chocolate" "conclusion" "contribution" "cookie" "courage" "dad" "desk" "drawer" "establishment" "examination" "garbage" "grocery" "honey" "impression" "improvement" "independence" "insect" "inspection" "inspector" "king" "ladder" "menu" "penalty" "piano" "potato" "profession" "professor" "quantity" "reaction" "requirement" "salad" "sister" "supermarket" "tongue" "weakness" "wedding" "affair" "ambition" "analyst" "apple" "assignment" "assistant" "bathroom" "bedroom" "beer" "birthday" "celebration" "championship" "cheek" "client" "consequence" "departure" "diamond" "dirt" "ear" "fortune" "friendship" "funeral" "gene" "girlfriend" "hat" "indication" "intention" "lady" "midnight" "negotiation" "obligation" "passenger" "pizza" "platform" "poet" "pollution" "recognition" "reputation" "shirt" "sir" "speaker" "stranger" "surgery" "sympathy" "tale" "throat" "trainer" "uncle" "youth" "time" "work" "film" "water" "money" "example" "while" "business" "study" "game" "life" "form" "air" "day" "place" "number" "part" "field" "fish" "back" "process" "heat" "hand" "experience" "job" "book" "end" "point" "type" "home" "economy" "value" "body" "market" "guide" "interest" "state" "radio" "course" "company" "price" "size" "card" "list" "mind" "trade" "line" "care" "group" "risk" "word" "fat" "force" "key" "light" "training" "name" "school" "top" "amount" "level" "order" "practice" "research" "sense" "service" "piece" "web" "boss" "sport" "fun" "house" "page" "term" "test" "answer" "sound" "focus" "matter" "kind" "soil" "board" "oil" "picture" "access" "garden" "range" "rate" "reason" "future" "site" "demand" "exercise" "image" "case" "cause" "coast" "action" "age" "bad" "boat" "record" "result" "section" "building" "mouse" "cash") "List of nouns used in password-generator-words function." 29 | :group 'password-generator 30 | :type '(repeat string)) 31 | 32 | (defcustom password-generator-vocabulary-verbs '("accept" "accuse" "achieve" "acknowledge" "acquire" "adapt" "add" "adjust" "admire" "admit" "adopt" "adore" "advise" "afford" "agree" "aim" "allow" "announce" "anticipate" "apologize" "appear" "apply" "appreciate" "approach" "approve" "argue" "arise" "arrange" "arrive" "ask" "assume" "assure" "astonish" "attach" "attempt" "attend" "attract" "avoid" "awake" "bake" "bathe" "be" "bear" "beat" "become" "beg" "begin" "behave" "believe" "belong" "bend" "bet" "bind" "bite" "blow" "boil" "borrow" "bounce" "bow" "break" "breed" "bring" "broadcast" "build" "burn" "burst" "buy" "calculate" "can/could" "care" "carry" "catch" "celebrate" "change" "choose" "chop" "claim" "climb" "cling" "come" "commit" "communicate" "compare" "compete" "complain" "complete" "concern" "confirm" "consent" "consider" "consist" "consult" "contain" "continue" "convince" "cook" "cost" "count" "crawl" "create" "creep" "criticize" "cry" "cut" "dance" "dare" "deal" "decide" "defer" "delay" "deliver" "demand" "deny" "depend" "describe" "deserve" "desire" "destroy" "determine" "develop" "differ" "disagree" "discover" "discuss" "dislike" "distribute" "dive" "do" "doubt" "drag" "dream" "drill" "drink" "drive" "drop" "dry" "earn" "eat" "emphasize" "enable" "encourage" "engage" "enhance" "enjoy" "ensure" "entail" "enter" "establish" "examine" "exist" "expand" "expect" "experiment" "explain" "explore" "extend" "fail" "fall" "feed" "feel" "fight" "find" "finish" "fit" "fly" "fold" "follow" "forbid" "forget" "forgive" "freeze" "fry" "generate" "get" "give" "go" "grind" "grow" "hang" "happen" "hate" "have" "hear" "hesitate" "hide" "hit" "hold" "hop" "hope" "hug" "hurry" "hurt" "identify" "ignore" "illustrate" "imagine" "imply" "impress" "improve" "include" "incorporate" "indicate" "inform" "insist" "install" "intend" "introduce" "invest" "investigate" "involve" "iron" "jog" "jump" "justify" "keep" "kick" "kiss" "kneel" "knit" "know" "lack" "laugh" "lay" "lead" "lean" "leap" "learn" "leave" "lend" "lie" "lift" "light" "like" "listen" "look" "lose" "love" "maintain" "make" "manage" "matter" "may" "mean" "measure" "meet" "melt" "mention" "might" "mind" "miss" "mix" "mow" "must" "need" "neglect" "negotiate" "observe" "obtain" "occur" "offer" "open" "operate" "order" "organize" "ought to" "overcome" "overtake" "owe" "own" "paint" "participate" "pay" "peel" "perform" "persuade" "pinch" "plan" "play" "point" "possess" "postpone" "pour" "practice" "prefer" "prepare" "pretend" "prevent" "proceed" "promise" "propose" "protect" "prove" "pull" "punch" "pursue" "push" "put" "qualify" "quit" "react" "read" "realize" "recall" "receive" "recollect" "recommend" "reduce" "refer" "reflect" "refuse" "regret" "relate" "relax" "relieve" "rely" "remain" "remember" "remind" "repair" "replace" "represent" "require" "resent" "resist" "retain" "retire" "rid" "ride" "ring" "rise" "risk" "roast" "run" "sanction" "satisfy" "say" "scrub" "see" "seem" "sell" "send" "serve" "set" "settle" "sew" "shake" "shall" "shed" "shine" "shoot" "should" "show" "shrink" "shut" "sing" "sink" "sit" "ski" "sleep" "slice" "slide" "slip" "smell" "snore" "solve" "sow" "speak" "specify" "spell" "spend" "spill" "spit" "spread" "squat" "stack" "stand" "start" "steal" "stick" "sting" "stink" "stir" "stop" "stretch" "strike" "struggle" "study" "submit" "succeed" "suffer" "suggest" "supply" "suppose" "surprise" "survive" "swear" "sweep" "swell" "swim" "swing" "take" "talk" "taste" "teach" "tear" "tell" "tend" "think" "threaten" "throw" "tiptoe" "tolerate" "translate" "try" "understand" "vacuum" "value" "vary" "volunteer" "wait" "wake" "walk" "want" "warn" "wash" "watch" "wave" "wear" "weep" "weigh" "whip" "will" "win" "wish" "would" "write") "List of verbs used in password-generator-words function." 33 | :group 'password-generator 34 | :type '(repeat string)) 35 | 36 | (defcustom password-generator-vocabulary-adjectives '("different" "used" "important" "every" "large" "available" "popular" "able" "basic" "known" "various" "difficult" "several" "united" "historical" "hot" "useful" "mental" "scared" "additional" "emotional" "old" "political" "similar" "healthy" "financial" "medical" "traditional" "federal" "entire" "strong" "actual" "significant" "successful" "electrical" "expensive" "pregnant" "intelligent" "interesting" "poor" "happy" "responsible" "cute" "helpful" "recent" "willing" "nice" "wonderful" "impossible" "serious" "huge" "rare" "technical" "typical" "competitive" "critical" "electronic" "immediate" "aware" "educational" "environmental" "global" "legal" "relevant" "accurate" "capable" "dangerous" "dramatic" "efficient" "powerful" "foreign" "hungry" "practical" "psychological" "severe" "suitable" "numerous" "sufficient" "unusual" "consistent" "cultural" "existing" "famous" "pure" "afraid" "obvious" "careful" "latter" "unhappy" "acceptable" "aggressive" "boring" "distinct" "eastern" "logical" "reasonable" "strict" "administrative" "automatic" "civil" "former" "massive" "southern" "unfair" "visible" "alive" "angry" "desperate" "exciting" "friendly" "lucky" "realistic" "sorry" "ugly" "unlikely" "anxious" "comprehensive" "curious" "impressive" "informal" "inner" "pleasant" "sexual" "sudden" "terrible" "unable" "weak" "wooden" "asleep" "confident" "conscious" "decent" "embarrassed" "guilty" "lonely" "mad" "nervous" "odd" "remarkable" "substantial" "suspicious" "tall" "tiny" "more" "some" "one" "all" "many" "most" "other" "such" "even" "new" "just" "good" "any" "each" "much" "own" "great" "another" "same" "few" "free" "right" "still" "best" "public" "human" "both" "local" "sure" "better" "general" "specific" "enough" "long" "small" "less" "high" "certain" "little" "common" "next" "simple" "hard" "past" "big" "possible" "particular" "real" "major" "personal" "current" "left" "national" "least" "natural" "physical" "short" "last" "single" "individual" "main" "potential" "professional" "international" "lower" "open" "according" "alternative" "special" "working" "true" "whole" "clear" "dry" "easy" "cold" "commercial" "full" "low" "primary" "worth" "necessary" "positive" "present" "close" "creative" "green" "late" "fit" "glad" "proper" "complex" "content" "due" "effective" "middle" "regular" "fast" "independent" "original" "wide" "beautiful" "complete" "active" "negative" "safe" "visual" "wrong" "ago" "quick" "ready" "straight" "white" "direct" "excellent" "extra" "junior" "pretty" "unique" "classic" "final" "overall" "private" "separate" "western" "alone" "familiar" "official" "perfect" "bright" "broad" "comfortable" "flat" "rich" "warm" "young" "heavy" "valuable" "correct" "leading" "slow" "clean" "fresh" "normal" "secret" "tough" "brown" "cheap" "deep" "objective" "secure" "thin" "chemical" "cool" "extreme" "exact" "fair" "fine" "formal" "opposite" "remote" "total" "vast" "lost" "smooth" "dark" "double" "equal" "firm" "frequent" "internal" "sensitive" "constant" "minor" "previous" "raw" "soft" "solid" "weird" "amazing" "annual" "busy" "dead" "false" "round" "sharp" "thick" "wise" "equivalent" "initial" "narrow" "nearby" "proud" "spiritual" "wild" "adult" "apart" "brief" "crazy" "prior" "rough" "sad" "sick" "strange" "external" "illegal" "loud" "mobile" "nasty" "ordinary" "royal" "senior" "super" "tight" "upper" "yellow" "dependent" "funny" "gross" "ill" "spare" "sweet" "upstairs" "usual" "brave" "calm" "dirty" "downtown" "grand" "honest" "loose" "male" "quiet" "brilliant" "dear" "drunk" "empty" "female" "inevitable" "neat" "ok" "representative" "silly" "slight" "smart" "stupid" "temporary" "weekly" "that" "this" "what" "which" "time" "these" "work" "no" "only" "then" "first" "money" "over" "business" "his" "game" "think" "after" "life" "day" "home" "economy" "away" "either" "fat" "key" "training" "top" "level" "far" "fun" "house" "kind" "future" "action" "live" "period" "subject" "mean" "stock" "chance" "beginning" "upset" "chicken" "head" "material" "salt" "car" "appropriate" "inside" "outside" "standard" "medium" "choice" "north" "square" "born" "capital" "shot" "front" "living" "plastic" "express" "feeling" "otherwise" "plus" "savings" "animal" "budget" "minute" "character" "maximum" "novel" "plenty" "select" "background" "forward" "glass" "joint" "master" "red" "vegetable" "ideal" "kitchen" "mother" "party" "relative" "signal" "street" "connect" "minimum" "sea" "south" "status" "daughter" "hour" "trick" "afternoon" "gold" "mission" "agent" "corner" "east" "neither" "parking" "routine" "swimming" "winter" "airline" "designer" "dress" "emergency" "evening" "extension" "holiday" "horror") "List of adjectives used in password-generator-words function." 37 | :group 'password-generator 38 | :type '(repeat string)) 39 | 40 | (defcustom password-generator-words-gap "." "Gap used between words in password-generator-words function." :group 'password-generator :type 'string) 41 | 42 | (defcustom password-generator-simple-length 8 "Password length for password-generator-simple." :group 'password-generator :type 'integer) 43 | (defcustom password-generator-numeric-length 4 "Password length for password-generator-numeric." :group 'password-generator :type 'integer) 44 | (defcustom password-generator-phonetic-length 8 "Password length for password-generator-phonetic." :group 'password-generator :type 'integer) 45 | (defcustom password-generator-strong-length 12 "Password length for password-generator-strong." :group 'password-generator :type 'integer) 46 | (defcustom password-generator-paranoid-length 20 "Password length for password-generator-paranoid." :group 'password-generator :type 'integer) 47 | (defcustom password-generator-words-length 4 "Words count in password generated by password-generator-words function." :group 'password-generator :type 'integer) 48 | (defcustom password-generator-custom-length 8 "Words count in password generated by password-generator-custom function." :group 'password-generator :type 'integer) 49 | 50 | (defcustom password-generator-custom-alphabet "абвгдеёжзийклмно" "Alphabet used by password-generator-custom function." :group 'password-generator :type 'string) 51 | 52 | 53 | 54 | ;;;###autoload 55 | (defun password-generator-random (max) 56 | "Random number limited by MAX. Feel free to rewrite this random. Just don't make it too slow." 57 | (let* 58 | ((random-value (random max))) 59 | 60 | random-value)) 61 | 62 | ;;;###autoload 63 | (defun password-generator-random-list-element (list) 64 | "Return random element from LIST." 65 | (nth (- (password-generator-random (length list)) 1) list)) 66 | 67 | 68 | ;;;###autoload 69 | (defun password-generator-get-random-string-char (string) 70 | "You pass here STRING. You get random character from it." 71 | (let ((n (password-generator-random (length string)))) 72 | (char-to-string (elt string n)))) 73 | 74 | 75 | ;;;###autoload 76 | (defun password-generator-generate-internal (symbols-for-pass pass-length) 77 | "Generate the password with given vocabulary and length. SYMBOLS-FOR-PASS is a string contining lphabet used for password generation. PASS-LENGTH limits the password length." 78 | (let* 79 | ((iter 0) 80 | (password "")) 81 | (while (< iter pass-length) 82 | (progn 83 | (setq 84 | password 85 | (concat password (password-generator-get-random-string-char symbols-for-pass))) 86 | (setq iter (+ 1 iter)))) 87 | password)) 88 | 89 | 90 | ;;;###autoload 91 | (defun password-generator-simple (&optional pre-len return) 92 | "Minimal viable password for most of web systems. It is not secure but allow to register. PRE-LEN is prefix arg that defines password lenght. RETURN specifies if password should be returned or inserted." 93 | (interactive) 94 | (let* ( 95 | (password "") 96 | (pass-length (or pre-len current-prefix-arg password-generator-simple-length)) 97 | (symbols-for-pass "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ")) 98 | (setq password (password-generator-generate-internal symbols-for-pass pass-length)) 99 | (cond ((equal nil return) (insert password)) (t password)))) 100 | 101 | 102 | ;;;###autoload 103 | (defun password-generator-strong (&optional pre-len return) 104 | "The best password you can get. Some symbols does not included to make you free from problems which occurs when your shell try interpolate $, \\ and others. PRE-LEN is prefix arg that defines password lenght. RETURN specifies if password should be returned or inserted." 105 | (interactive) 106 | (let* ( 107 | (password "") 108 | (pass-length (or pre-len current-prefix-arg password-generator-strong-length)) 109 | (symbols-for-pass "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ_@!.^%,&-")) 110 | (setq password (password-generator-generate-internal symbols-for-pass pass-length)) 111 | (cond ((equal nil return) (insert password)) (t password)))) 112 | 113 | 114 | ;;;###autoload 115 | (defun password-generator-paranoid (&optional pre-len return) 116 | "Good thing to use if you really care about bruteforce. Not all applications handle special characters presented in such password properly. Be ready to escape special characters if you will pass such password via ssh command or so. PRE-LEN is prefix arg that defines password lenght. RETURN specifies if password should be returned or inserted." 117 | (interactive) 118 | (let* ( 119 | (password "") 120 | (pass-length (or pre-len current-prefix-arg password-generator-paranoid-length)) 121 | (symbols-for-pass "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_-+=/?,.><[]{}~")) 122 | (setq password (password-generator-generate-internal symbols-for-pass pass-length)) 123 | (cond ((equal nil return) (insert password)) (t password)))) 124 | 125 | 126 | ;;;###autoload 127 | (defun password-generator-numeric (&optional pre-len return) 128 | "Yeah, there are sill reasons to use numeric passwords like credit card PIN-code. PRE-LEN is prefix arg that defines password lenght. RETURN specifies if password should be returned or inserted." 129 | (interactive) 130 | (let* ( 131 | (password "") 132 | (pass-length (or pre-len current-prefix-arg password-generator-numeric-length)) 133 | (symbols-for-pass "0123456789")) 134 | (setq password (password-generator-generate-internal symbols-for-pass pass-length)) 135 | (cond ((equal nil return) (insert password)) (t password)))) 136 | 137 | 138 | ;;;###autoload 139 | (defun password-generator-phonetic (&optional pre-len return) 140 | "It will be easy to remeber, because of fonetic, but not so secure... PRE-LEN is prefix arg that defines password lenght. RETURN specifies if password should be returned or inserted." 141 | (interactive) 142 | (let* 143 | ((password "") 144 | (letters-A "eyuioa") 145 | (letters-B "wrtpsdfghjkzxcvbnm") 146 | (letters-N "123456789") 147 | (pass-length (or pre-len current-prefix-arg password-generator-simple-length)) 148 | (iter 0) 149 | (max-iter (+ 1 (/ pass-length 3)))) 150 | (while (< iter max-iter) 151 | (progn 152 | (setq password (concat password 153 | (password-generator-get-random-string-char letters-B) 154 | (password-generator-get-random-string-char letters-A) 155 | (password-generator-get-random-string-char letters-N))) 156 | (setq iter (+ 1 iter)))) 157 | (setq password (substring password 0 pass-length)) 158 | (cond ((equal nil return) (insert password)) (t password)))) 159 | 160 | ;;;###autoload 161 | (defun password-generator-custom (&optional pre-len return) 162 | "Password generated with your own alphabet. PRE-LEN is prefix arg that defines password lenght. RETURN specifies if password should be returned or inserted." 163 | (interactive) 164 | (let* ( 165 | (password "") 166 | (pass-length (or pre-len current-prefix-arg password-generator-custom-length)) 167 | (symbols-for-pass password-generator-custom-alphabet)) 168 | (setq password (password-generator-generate-internal symbols-for-pass pass-length)) 169 | (cond ((equal nil return) (insert password)) (t password)))) 170 | 171 | 172 | 173 | (defun password-generator-words (&optional pre-len return) 174 | "Correct Horse Battery Staple." 175 | (interactive) 176 | (let* ( 177 | (password "") 178 | (vocabulary (list 179 | password-generator-vocabulary-nouns 180 | password-generator-vocabulary-adjectives 181 | password-generator-vocabulary-verbs)) 182 | (iter 0) 183 | (max-iter (or pre-len current-prefix-arg 3))) 184 | (while (< iter max-iter) 185 | (progn 186 | (setq iter (+ 1 iter)) 187 | (setq password (concat password 188 | (password-generator-random-list-element (password-generator-random-list-element vocabulary)) password-generator-words-gap)))) 189 | (setq password (substring password 0 (- (length password) 1))) 190 | (cond ((equal nil return) (insert password)) (t password)))) 191 | 192 | 193 | (provide 'password-generator) 194 | 195 | ;;; password-generator.el ends here 196 | --------------------------------------------------------------------------------