Show Posts
|
Pages: [1] 2 »
|
I been looking at NEM coins community wallet program to try and figure out how the wallets are encrypted. I found this code in the source and it appears to be were it encrypts the wallet. Can somebody explain to me how the code is encrypting the wallet? To me it appears to do multiple rounds, but I'm not sure how it determines the amount of rounds. The entire source can be found at https://github.com/NemProject/NemCommunityClient/archive/v0.6.31.zippackage org.nem.console.utils;
import org.apache.commons.io.IOUtils; import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.io.*; import org.bouncycastle.crypto.modes.CBCBlockCipher; import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher; import org.bouncycastle.crypto.params.*; import org.nem.core.crypto.Hashes; import org.nem.core.utils.*;
import java.io.*;
/** * Helper class for reading and writing encrypted data. */ class EncryptedInputOutput { private static final int BLOCK_SIZE = 16;
private final String password; private final int numHashes;
/** * Creates a new encrypted input / output object. * * @param password The password. * @param numHashes The number of hashes. */ public EncryptedInputOutput(final String password, final int numHashes) { this.password = password; this.numHashes = numHashes;
if (StringUtils.isNullOrEmpty(this.password)) { throw new IllegalArgumentException("password cannot be empty"); }
if (this.numHashes < 1) { throw new IllegalArgumentException("password must be hashed at least once"); } }
/** * Writes a blob of data to the specified encrypted file. * * @param fileName The file to which to write. * @param data The plain data. */ public void writeTo(final String fileName, final byte[] data) { ExceptionUtils.propagateVoid( () -> this.writeToInternal(fileName, data), ex -> new StorageException(String.format("writing to '%s' failed", fileName), ex)); }
private void writeToInternal(final String fileName, final byte[] data) throws IOException { FileMust.notExist(fileName); // TODO: this doesn't belong here
try (final OutputStream outputStream = new FileOutputStream(fileName)) { final PaddedBufferedBlockCipher cipher = this.getCipher(true); try (final CipherOutputStream cos = new CipherOutputStream(outputStream, cipher)) { cos.write(data); } } }
/** * Reads a block of blob from data to the specified encrypted file. * * @param fileName The file to which to write. * @return The data. */ public byte[] readFrom(final String fileName) { return ExceptionUtils.propagate( () -> this.readFromInternal(fileName), ex -> new StorageException(String.format("reading from '%s' failed", fileName), ex)); }
private byte[] readFromInternal(final String fileName) throws IOException { FileMust.exist(fileName); // TODO: this doesn't belong here
final PaddedBufferedBlockCipher cipher = this.getCipher(false); try (final InputStream inputStream = new FileInputStream(fileName)) { try (final CipherInputStream cis = new CipherInputStream(inputStream, cipher)) { return IOUtils.toByteArray(cis); } } }
private PaddedBufferedBlockCipher getCipher(final boolean encrypt) { byte[] hash = Hashes.sha3_256(StringEncoder.getBytes(this.password)); for (int i = 0; i < this.numHashes - 1; ++i) { hash = Hashes.sha3_256(hash); }
final KeyParameter key = new KeyParameter(hash);
// create and initialize the cipher final PaddedBufferedBlockCipher resultCipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESEngine())); final ParametersWithIV parameterIV = new ParametersWithIV(key, new byte[BLOCK_SIZE]); resultCipher.init(encrypt, parameterIV); return resultCipher; } }
|
|
|
Here's an update of my problem I'm having with cgminer. I thought for the heck of it I would see if cgminer would compile other kernels and it does, every one except scrypt. I used GPU caps viewer to see if opencl was working it runs all the demos for opencl. The luxmark-win64-v2.0 benchmark also runs fine. So at this point I assume opencl is installed and working correctly? Anybody have any thoughts? This is the config I'm using { "pools" : [ { "url" : "http://stratum.give-me-coins.com:3333", "user" : "ifowler46.5", "pass" : "LTC" } ] , "intensity" : "1", "vectors" : "1", "worksize" : "256", "kernel" : "scrypt", "lookup-gap" : "0", "gpu-engine" : "0-0", "gpu-fan" : "100", "gpu-memclock" : "0", "gpu-memdiff" : "0", "gpu-powertune" : "0", "gpu-vddc" : "0.000", "temp-cutoff" : "95", "temp-overheat" : "85", "temp-target" : "75", "api-port" : "4028", "expiry" : "120", "gpu-dyninterval" : "7", "gpu-platform" : "0", "gpu-threads" : "2", "hotplug" : "5", "log" : "5", "no-pool-disable" : true, "queue" : "1", "scan-time" : "60", "temp-hysteresis" : "3", "shares" : "0", "kernel-path" : "/usr/local/bin" }
![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fit5.webege.com%2Fmining2.jpg&t=663&c=yh3jJF3U203hXA)
|
|
|
I been having a hard time getting my 4850 mining at all. Have you got it to mine at all?
|
|
|
Seems rough redirected me as soon as the page loaded.
|
|
|
Yeah that's what I thought. This card is really stumping me maybe because its a 4000 series? Are you using version 3.7.2?
I have tried these with the same results 2.11.4 2.11.2 3.2.0 3.7.2 I also tried different versions of bfgminer same thing happens just sits hung up using 100% of a cpu core.
|
|
|
Not on scrypt the bitminter program works fine. I download a fresh copy of cgminer and ran cgminer.exe --scrypt and entered the pool info. Is that starting with no settings? If i run cgminer.exe it seems to use the sha256 kernal and reports hash rate in MH/s. ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fit5.webege.com%2Fmining.jpg&t=663&c=etA0OsOy5Rt2wA) It will stay like this with no gpu load
|
|
|
I been spending hours trying to get a HD4850 mining scrypt coins. Thought I would see if anybody could help me. This is the command i have try to start cgminer with. --scrypt -T -o stratum+tcp://xxxxx.xxx -u xxxxxx -pxxxxxx --thread-concurrency 400 -I 10 -g 2 -w 128 It will just sit at setting pool difficulty. I change thread-concurrency from 400-3000, -g 1 and -g 2, I have also changed the worksize to 256. Nothing seems to work. I'm using the 13-9-legacy_vista_win7_64_dd_ccc_whql driver with the AMD-APP-SDK-v2.7-Windows-64. If i don't install the sdk opencl is not installed on the system. I've done multiple uninstalls of drivers and re-installs. Gpu-z and furmark both see opencl after the SDK. The bitminter program will mine as long as opencl is install but cgminer sits there stalled. I have tried starting cgminer with cgminer.exe --scrypt and enter pool info. After hitting enter after the password it will just sit there doing nothing. I try using text only (-T)same thing. Ian EDIT: Turns out re-installing windows 7 and installing the driver fixed the issues that I was having. I used the latest driver for the card 13-9-legacy_vista_win7_64_dd_ccc_whql.exe
|
|
|
What are the temps your getting with the card? I bought the double fan version and the cooling on them was so bad i had to get aftermarket coolers for them.
|
|
|
5gcWkeKhSkGKhECRKLARrrnZukK2JmUqjn
thanks
|
|
|
200 mh, , growing fast!!!! BECOME RICHFISH TODAY!!!! ALL TIME EARNINGS AT 106% OF EXPECTED =))(94% expected shares on average per block!!!!) LONG HISTORY WITH LTC/DOGE --- Millions of USD in cryptos paid out. Why risk it with an unproven/unknown pool? https://coinye.netcodepool.org/
![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fi1210.photobucket.com%2Falbums%2Fcc408%2Fninjapotamuspics%2Fcoinyenetcodepool.png&t=663&c=lh1P5Lt6BsmakQ) Been using this pool and been hashing away all night and day. ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) Wasn't able to mine at release because many of the pools I started with were nonfunctional.
|
|
|
What temps are these cards running at?
|
|
|
is this still working?
Yes, just slow because its CPU only. ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fit5.webege.com%2FScryptMiner.jpg&t=663&c=ML0fbQR67mT7HQ)
|
|
|
Ok I'll take 2.
|
|
|
Was wonder if anybody had a spare waterblock for a 5970 lying around. I live in the United States.
|
|
|
Voted twice as well.
17Y6CVZnWWb6XkVBnEQYNKgeg63AJ5wpKQ
|
|
|
I didn't say you were not legit, but there was a virus going around that asked people to enter a $200 moneypak to unlock there computers. I was trying to save you some $$ if that was the case.
|
|
|
It doesn't happen to be the FBI virus asking for it?
|
|
|
|