If you cannot rewrite it into proper java code, it is better not to do it at all, as you may produce many bugs.
But if you want to have it done, contact me and I may prepare software for you, you will not pay much
Coming back to subject: if you have only 11 words, you may produce 128 12th words, so you may have 128 correct seeds.
import org.bitcoinj.crypto.MnemonicCode;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
public class Find12 {
private static final int TARGET_SIZE = 12;
private static List
private static MessageDigest SHA256;
private static int CONCAT_LEN_BITS;
private static int CONCAT_LEN_BITS_DIV_33;
private static int CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33;
private static int CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33__DIV8;
public static void main(String args[]) throws IOException {
String[] input = new String[]{"faith","always","acquire","host","amused",
"mercy","horn","service","series","stove","off"};
Find12 find12 = new Find12();
find12.findSeed(input);
}
public Find12() throws IOException {
WORDS = new MnemonicCode().getWordList();
try {
SHA256 = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException var1) {
throw new RuntimeException(var1);
}
this.CONCAT_LEN_BITS = 11 * TARGET_SIZE;
this.CONCAT_LEN_BITS_DIV_33 = CONCAT_LEN_BITS/33;
this.CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33 = CONCAT_LEN_BITS - CONCAT_LEN_BITS_DIV_33;
this.CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33__DIV8 = CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33/8;
}
private void findSeed(String[] input) {
for(int i=0; i
seed.add(WORDS.get(i));
if (checksumCheck(seed)){
System.out.println(Utils.SPACE_JOINER.join(seed));
}
}
}
private boolean checksumCheck(List
boolean[] concatBits = new boolean[CONCAT_LEN_BITS];
int wordindex = 0;
int hash;
for(Iterator checksumLengthBits = words.iterator(); checksumLengthBits.hasNext(); ++wordindex) {
String entropyLengthBits = (String)checksumLengthBits.next();
int entropy = Collections.binarySearch(WORDS, entropyLengthBits);
if(entropy < 0) {
return false;
}
for(hash = 0; hash < 11; ++hash) {
concatBits[wordindex * 11 + hash] = (entropy & 1 << 10 - hash) != 0;
}
}
byte[] var13 = new byte[CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33__DIV8];
for(hash = 0; hash < var13.length; ++hash) {
for(int hashBits = 0; hashBits < 8; ++hashBits) {
if(concatBits[hash * 8 + hashBits]) {
var13[hash] = (byte)(var13[hash] | 1 << 7 - hashBits);
}
}
}
byte[] var14 = hash(var13, 0, var13.length, SHA256);
boolean[] var15 = bytesToBits(var14);
for(int i = 0; i < CONCAT_LEN_BITS_DIV_33; ++i) {
if(concatBits[CONCAT_LEN_BITS_MINUS_CONCAT_LEN_BITS_DIV_33 + i] != var15[i]) {
return false;
}
}
return true;
}
private boolean[] bytesToBits(byte[] data) {
boolean[] bits = new boolean[data.length * 8];
for(int i = 0; i < data.length; ++i) {
for(int j = 0; j < 8; ++j) {
bits[i * 8 + j] = (data[i] & 1 << 7 - j) != 0;
}
}
return bits;
}
public byte[] hash(byte[] input, int offset, int length, MessageDigest sha256) {
sha256.reset();
sha256.update(input, offset, length);
return sha256.digest();
}
}
Seed from the example (faith always acquire host amused mercy horn service series stove off) produces:
faith always acquire host amused mercy horn service series stove off across
faith always acquire host amused mercy horn service series stove off ahead
faith always acquire host amused mercy horn service series stove off alley
faith always acquire host amused mercy horn service series stove off announce
faith always acquire host amused mercy horn service series stove off armed
faith always acquire host amused mercy horn service series stove off ask
faith always acquire host amused mercy horn service series stove off avocado
faith always acquire host amused mercy horn service series stove off axis
faith always acquire host amused mercy horn service series stove off banana
faith always acquire host amused mercy horn service series stove off beef
faith always acquire host amused mercy horn service series stove off bind
faith always acquire host amused mercy horn service series stove off bonus
faith always acquire host amused mercy horn service series stove off breeze
faith always acquire host amused mercy horn service series stove off buffalo
faith always acquire host amused mercy horn service series stove off buyer
faith always acquire host amused mercy horn service series stove off canoe
faith always acquire host amused mercy horn service series stove off catalog
faith always acquire host amused mercy horn service series stove off certain
faith always acquire host amused mercy horn service series stove off champion
faith always acquire host amused mercy horn service series stove off clap
faith always acquire host amused mercy horn service series stove off cloud
faith always acquire host amused mercy horn service series stove off coast
faith always acquire host amused mercy horn service series stove off comic
faith always acquire host amused mercy horn service series stove off corn
faith always acquire host amused mercy horn service series stove off cream
faith always acquire host amused mercy horn service series stove off crunch
faith always acquire host amused mercy horn service series stove off damage
faith always acquire host amused mercy horn service series stove off delay
faith always acquire host amused mercy horn service series stove off desk
faith always acquire host amused mercy horn service series stove off despair
faith always acquire host amused mercy horn service series stove off disagree
faith always acquire host amused mercy horn service series stove off donor
faith always acquire host amused mercy horn service series stove off dumb
faith always acquire host amused mercy horn service series stove off dutch
faith always acquire host amused mercy horn service series stove off ecology
faith always acquire host amused mercy horn service series stove off end
faith always acquire host amused mercy horn service series stove off entry
faith always acquire host amused mercy horn service series stove off erase
faith always acquire host amused mercy horn service series stove off excess
faith always acquire host amused mercy horn service series stove off fabric
faith always acquire host amused mercy horn service series stove off faith
faith always acquire host amused mercy horn service series stove off fence
faith always acquire host amused mercy horn service series stove off film
faith always acquire host amused mercy horn service series stove off flush
faith always acquire host amused mercy horn service series stove off fold
faith always acquire host amused mercy horn service series stove off frequent
faith always acquire host amused mercy horn service series stove off garden
faith always acquire host amused mercy horn service series stove off gauge
faith always acquire host amused mercy horn service series stove off glimpse
faith always acquire host amused mercy horn service series stove off gospel
faith always acquire host amused mercy horn service series stove off guess
faith always acquire host amused mercy horn service series stove off harvest
faith always acquire host amused mercy horn service series stove off hedgehog
faith always acquire host amused mercy horn service series stove off holiday
faith always acquire host amused mercy horn service series stove off humble
faith always acquire host amused mercy horn service series stove off illegal
faith always acquire host amused mercy horn service series stove off indicate
faith always acquire host amused mercy horn service series stove off inmate
faith always acquire host amused mercy horn service series stove off invite
faith always acquire host amused mercy horn service series stove off join
faith always acquire host amused mercy horn service series stove off kitchen
faith always acquire host amused mercy horn service series stove off label
faith always acquire host amused mercy horn service series stove off lawsuit
faith always acquire host amused mercy horn service series stove off lesson
faith always acquire host amused mercy horn service series stove off live
faith always acquire host amused mercy horn service series stove off love
faith always acquire host amused mercy horn service series stove off manual
faith always acquire host amused mercy horn service series stove off maximum
faith always acquire host amused mercy horn service series stove off merry
faith always acquire host amused mercy horn service series stove off minor
faith always acquire host amused mercy horn service series stove off monkey
faith always acquire host amused mercy horn service series stove off mushroom
faith always acquire host amused mercy horn service series stove off negative
faith always acquire host amused mercy horn service series stove off net
faith always acquire host amused mercy horn service series stove off number
faith always acquire host amused mercy horn service series stove off obtain
faith always acquire host amused mercy horn service series stove off orange
faith always acquire host amused mercy horn service series stove off output
faith always acquire host amused mercy horn service series stove off panther
faith always acquire host amused mercy horn service series stove off patient
faith always acquire host amused mercy horn service series stove off permit
faith always acquire host amused mercy horn service series stove off pill
faith always acquire host amused mercy horn service series stove off plug
faith always acquire host amused mercy horn service series stove off potato
faith always acquire host amused mercy horn service series stove off pride
faith always acquire host amused mercy horn service series stove off prosper
faith always acquire host amused mercy horn service series stove off quit
faith always acquire host amused mercy horn service series stove off rack
faith always acquire host amused mercy horn service series stove off rather
faith always acquire host amused mercy horn service series stove off reform
faith always acquire host amused mercy horn service series stove off renew
faith always acquire host amused mercy horn service series stove off retreat
faith always acquire host amused mercy horn service series stove off river
faith always acquire host amused mercy horn service series stove off rural
faith always acquire host amused mercy horn service series stove off satisfy
faith always acquire host amused mercy horn service series stove off scan
faith always acquire host amused mercy horn service series stove off seminar
faith always acquire host amused mercy horn service series stove off service
faith always acquire host amused mercy horn service series stove off shoe
faith always acquire host amused mercy horn service series stove off similar
faith always acquire host amused mercy horn service series stove off slam
faith always acquire host amused mercy horn service series stove off smooth
faith always acquire host amused mercy horn service series stove off soft
faith always acquire host amused mercy horn service series stove off speak
faith always acquire host amused mercy horn service series stove off squeeze
faith always acquire host amused mercy horn service series stove off stand
faith always acquire host amused mercy horn service series stove off struggle
faith always acquire host amused mercy horn service series stove off sugar
faith always acquire host amused mercy horn service series stove off surface
faith always acquire host amused mercy horn service series stove off system
faith always acquire host amused mercy horn service series stove off test
faith always acquire host amused mercy horn service series stove off thunder
faith always acquire host amused mercy horn service series stove off token
faith always acquire host amused mercy horn service series stove off tonight
faith always acquire host amused mercy horn service series stove off tray
faith always acquire host amused mercy horn service series stove off trend
faith always acquire host amused mercy horn service series stove off twin
faith always acquire host amused mercy horn service series stove off undo
faith always acquire host amused mercy horn service series stove off uphold
faith always acquire host amused mercy horn service series stove off utility
faith always acquire host amused mercy horn service series stove off verb
faith always acquire host amused mercy horn service series stove off voice
faith always acquire host amused mercy horn service series stove off waste
faith always acquire host amused mercy horn service series stove off wealth
faith always acquire host amused mercy horn service series stove off where
faith always acquire host amused mercy horn service series stove off wonder
faith always acquire host amused mercy horn service series stove off wreck