04-11-2024, 01:13 PM
(This post was last modified: 04-11-2024, 01:17 PM by bingussssssss.)
hi, I just solved this --- i don't check this forum, but feel free to add me on discord if you don't hear back..
here's how you can fix it.
the first script will give you a 128 byte string, which you can then convert into a 12 word mnemonic with the 2nd script and import into your wallet.
tips appreciated: F8UghnajaBdfj5cNBSY8ztGg4EfnaY6XJayBPZiJTpm9 (SOL)
-- this 100% works, ping me on discord or here if you have trouble.
discord user: o7_
import base58
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from nacl.secret import SecretBox
from nacl.exceptions import CryptoError
# Encrypted data and parameters (assuming all are base58 encoded)
data = {
"encrypted": "",
"nonce": "",
"salt": "",
"iterations": 10000,
}
password = '' # Replace with your actual password
# Decode from Base58
salt = base58.b58decode(data['salt'])
nonce = base58.b58decode(data['nonce'])
encrypted_data = base58.b58decode(data['encrypted'])
# Derive the key using PBKDF2 with SHA-256
kdf = PBKDF2HMAC(
algorithm=hashes.SHA256(),
length=32,
salt=salt,
iterations=data['iterations'],
backend=default_backend()
)
key = kdf.derive(password.encode())
# Decrypt the data using PyNaCl's SecretBox
box = SecretBox(key)
try:
decrypted = box.decrypt(encrypted_data, nonce)
# Instead of attempting to decode as UTF-8, print the raw bytes or their hex representation
print("Decrypted data (hex):", decrypted.hex())
except CryptoError as e:
print(f"Decryption failed: {e}")
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
from mnemonic import Mnemonic
import binascii
# Decrypted data in hex
decrypted_hex = 'your_128_byte_string'
# Convert hex to bytes
entropy_bytes = binascii.unhexlify(decrypted_hex)
# Generate mnemonic from the entropy bytes
mnemo = Mnemonic("english")
mnemonic = mnemo.to_mnemonic(entropy_bytes)
print("Mnemonic:", mnemonic)
here's how you can fix it.
the first script will give you a 128 byte string, which you can then convert into a 12 word mnemonic with the 2nd script and import into your wallet.
tips appreciated: F8UghnajaBdfj5cNBSY8ztGg4EfnaY6XJayBPZiJTpm9 (SOL)
![Smile Smile](https://hashcat.net/forum/images/smilies/smile.gif)
discord user: o7_
import base58
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from nacl.secret import SecretBox
from nacl.exceptions import CryptoError
# Encrypted data and parameters (assuming all are base58 encoded)
data = {
"encrypted": "",
"nonce": "",
"salt": "",
"iterations": 10000,
}
password = '' # Replace with your actual password
# Decode from Base58
salt = base58.b58decode(data['salt'])
nonce = base58.b58decode(data['nonce'])
encrypted_data = base58.b58decode(data['encrypted'])
# Derive the key using PBKDF2 with SHA-256
kdf = PBKDF2HMAC(
algorithm=hashes.SHA256(),
length=32,
salt=salt,
iterations=data['iterations'],
backend=default_backend()
)
key = kdf.derive(password.encode())
# Decrypt the data using PyNaCl's SecretBox
box = SecretBox(key)
try:
decrypted = box.decrypt(encrypted_data, nonce)
# Instead of attempting to decode as UTF-8, print the raw bytes or their hex representation
print("Decrypted data (hex):", decrypted.hex())
except CryptoError as e:
print(f"Decryption failed: {e}")
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
##################SECOND SCRIPT BELOW##############################
from mnemonic import Mnemonic
import binascii
# Decrypted data in hex
decrypted_hex = 'your_128_byte_string'
# Convert hex to bytes
entropy_bytes = binascii.unhexlify(decrypted_hex)
# Generate mnemonic from the entropy bytes
mnemo = Mnemonic("english")
mnemonic = mnemo.to_mnemonic(entropy_bytes)
print("Mnemonic:", mnemonic)