Algorithm for name generation

Asked

Viewed 783 times

19

I did a lot of research, but I couldn’t find an algorithm that would do something like banks do. For example, when you first register in a 24-hour box, the machine will generate a password. In general, you are informed 3 or 4 pairs of letters as a password.

However, if noted, the letters they generate automatically make some sense if read as a word.

Example:

CE LA LU / XE GO U

It is knowledge something that achieves what I desire?

Thank you!

  • 11

    List of consonants and one of vowels , in the loop of repetitive choice alternately, will seem a word.

  • Right, no doubt, it works great, @Motta. Thanks!!! However, it is not intelligent as it is generated in these systems that I mentioned in the question. The pairs of acronyms generated there, make some sense with words of the Brazilian dictionary. :)

  • 1

    @Marcony, this example of LU LA XE GOU is real or created based on a memory of you? :)

  • Real, @brasofilo. I put a bar to separate because they are two different words. CE LA LU, remember cell phone. XE GO U, remember arrived.

  • 1

    CELALU remember cell phone is kind of forced. BTW, wants an algorithm that generates names, downloads a dictionary and selects words of certain sizes randomly ;)

  • 1

    My letter password does not remember, at all, any word. I think it’s kind of random even, within a set of syllables.

  • 1

    The question is : "something that looks like" or a word , the second being the solution of @Renan is the most viable

  • The @Paulohdsousa gave me one more idea, besides choosing a word from a dictionary, uses a Japanese dictionary ;)

  • 1

    This question generated a meta discussion. See also: http://meta.pt.stackoverflow.com/questions/1157/clarify

Show 4 more comments

1 answer

17


I made an algorithm of this in 2008. Ran in PHP.
I called it "pronounceable password"

The initial idea was like the @Motta comment.
Two lists: one of consonants and one of vowels:

ListaConsoantes = b c d f g j k l m n p r s t v x
ListaVogais = a e i o u

I improved the consonants and vowels to form more complex words:

ListaConsoantes  = b c d f g j k l m n p r s t v x 
ListaConsoantes2 = ch qu gu lh 
ListaConsoantesFim = s x r l m
ListaVogais      = a e i o u y 
ListaVogais2     = au ei oa ya

The function received the number of characters for the password to be generated, but this number was regarded as minimal for the algorithm to be able to complete the word, not stop in the middle of a syllable.

These phonemes can be expanded and stirred as desired.

the algorithm looked something like this (in pseudocode):

size = 8
senha = ''
if ( rand entre 0 ou 1 )
    // inicio com uma vogal simples ou não da ListaVogais [1]
    senha = ListaVogais[ rand ]
while senha.size < size
     // sorteio se uso uma consoante de ListaConsoantes ou ListaConsoantes2 [2]
     if ( rand entre 0 ou 1 )
         senha = senha + ListaConsoantes[ rand ]
     else
         senha = senha + ListaConsoantes2[ rand ]

     // sorteio se uso uma vogal de ListaVogais ou ListaVogais2 [3]
     if ( rand entre 0 ou 1 )
         senha = senha + ListaVogais[ rand ]
     else
         senha = senha + ListaVogais2[ rand ]

     // sorteio se uso uma consoante no fim da palavra [4]
     if ( rand entre 0 ou 1 )
         senha = senha + ListaConsoantesFim[ rand ]

Come out, nice little passwords.

could leave due to [1]:

baquichoba or Abaquichoba

could leave due to [2]:

baQUichoba or baDichoba

could leave due to [3]:

badOchoba or badAUchoba

could leave due to [4]:

banichoba or banichobaS

  • +1 for the effort. Now, the ideal would be to have more random passwords - it is possible to make an attack based on the similarity between the generated passwords.

  • 5

    Thank you, Edinho Almeida! Congratulations on your reply. As you said, it is pseudocode so that everyone can understand your idea and what you have prepared. Thanks for the contribution, really useful.

  • 6

    Show , should even roll some obscene passwords ... :)

  • 1

    You did good, baquichoba!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.