Generates 8 character pronounceable password

Developed In: SQL — Contributed by: Gunther Richter

Pronounceable Password Generator is written using a MySQL Stored Procedure. This is a very basic procedure to generate passwords for up to 8 characters randomly. The generated password is pronounceable and uses constants and vowels. The password created using this procedure is very weak and can be judged easily. You can add more characters to this constant and vowels and make customization. Code originally written in PHP by Max Dobbie-Holman. With this code a e.g. Trigger can generate a username and password without any external code. Generated tokens are like: tetrasun, goldulog, pudmumon, cemracet, rammedar, pollageb, nicgebom. This procedure can of course be modified to make stronger passwords.


Gunther Richter
SQL
  1. DROP PROCEDURE makeToken;
  2.  
  3. DELIMITER //
  4.  
  5. CREATE PROCEDURE makeToken ()
  6. BEGIN
  7. DECLARE x INT DEFAULT 0;
  8. DECLARE consts CHAR(12) DEFAULT 'bcdgklmnprst';
  9. DECLARE vowels CHAR(5) DEFAULT 'aeiou';
  10. DECLARE const CHAR(12) DEFAULT '';
  11. DECLARE vow CHAR(12) DEFAULT '';
  12.  
  13. WHILE x < 6 DO
  14. SET const = CONCAT(const, SUBSTR(consts, FLOOR(1 + (RAND() * 12)),1));
  15. SET vow = CONCAT(vow, SUBSTR(vowels, FLOOR(1 + (RAND() * 5)),1));
  16. SET x = x + 1;
  17. END WHILE;
  18.  
  19. INSERT INTO users SET password=CONCAT(SUBSTR(const, 1, 1), SUBSTR(vow, 1, 1), SUBSTR(const, 3, 1), SUBSTR(const, 2, 1),
  20. SUBSTR(vow, 2, 1), SUBSTR(const, 4, 1), SUBSTR(vow, 4, 1), SUBSTR(const, 5, 1));
  21.  
  22. END;
  23. //
  24. DELIMITER ;

Current Tags

You must be logged in to tag this tool

No Comments yet

Votes

Not yet rated.
You must be logged in to vote.

Watches

0 members are watching this tool
You must be logged in to track this tool.

Provide Feedback

Please note:
HTML will be purified, but we allow for a number of HTML tags so that you have the flexibility to decorate your comment text to some extent. The comments allow the following HTML tags:

strong, b, em, blockquote, a, code, pre

To put code into your comment, simply encapsulate your code with
[code language="XXX"][/code], where XXX is any common language, for instance "PHP", "SQL", "C", etc.



You must be logged in to comment