var ssbKeys = require('ssb-keys') var checkWord = require('check-word'), words = checkWord('en'); while(true) { // get candidate keys var key = ssbKeys.generate() var pub_key = key.public // split into 4..7 word chunks var possible_words = [] var min_size = 5 var max_size = 7 for(i = min_size; i <= max_size; i++) { possible_words.push(pub_key.substring( 0, i )) } for(var word of possible_words) { // check if only letters (+++ SPEED) if( is_letters(word) ) { // check if in dictionary if(words.check(word)) console.log(key) } } } function is_letters(str) { return /^[a-zA-Z]+$/.test(str) }