Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
solved: random word or dictionary
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 582

PostPosted: Tue May 28, 2019 5:22 pm    Post subject: solved: random word or dictionary Reply with quote

Hello

How can i create (choose) a random non-english word, or equivalently, an ASCII/UTF list of words of a dictionary.

For example, apg etc. create only passwords, and not actual words.

/usr/share/dict has only English words.

aspell exports and otherwise deals with "word lists", whatever that is, but not dictionaries.

So ...?


Last edited by jamapii on Tue May 28, 2019 5:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 517
Location: Inner Space

PostPosted: Tue May 28, 2019 5:39 pm    Post subject: Re: random word or dictionary Reply with quote

do you mean absolutely random words? like brute force?
for this you would have to write and iterator that would iterate trough a range of the ASCII table that would write down every possible combination that exists.
that would be used as a dictionary.
_________________
CLOSED|||||||||||LISTEN
SYN-SENT --> SYN-RECEIVED
ESTABLISHED <-- SYN-RECEIVED
ESTABLISHED --> ESTABLISHED
ESTABLISHED --> <DATA> --> ESTABLISHED
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 582

PostPosted: Tue May 28, 2019 5:45 pm    Post subject: Reply with quote

ok just my quick n dirty solution

something like

Code:

aspell -l de dump master > /tmp/t    # replace de with your favourite language
size=$(wc -l /tmp/t)
rnd=$(perl -e 'use Math::Round; print round rand '$size)
head -n $rnd /tmp/t | tail -n 1
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 582

PostPosted: Tue May 28, 2019 5:49 pm    Post subject: Reply with quote

oh thanks for the reply.

Truly random strings are easy to create with apg, pwgen, ranpwd. These make good passwords.

My select-a-random-word is for words, that should be pronounced and understood, but still be as random as possible.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 24079
Location: here

PostPosted: Tue May 28, 2019 6:07 pm    Post subject: Reply with quote

I'm not sure if I understand but with app-text/dictd and app-dicts/freedict-*
Code:
$ shuf -n1  /usr/lib64/dict/ita-eng.index | cut -d$'\t' -f1

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 582

PostPosted: Sun Jun 02, 2019 9:17 am    Post subject: Reply with quote

thanks a lot, now the script is just


aspell -l de dump master | shuf -n1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum