feat: add negative topups (#2835)
* feat: add negative topups * remove topup dialog --------- Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
+16
-1
@@ -1,6 +1,6 @@
|
||||
import base64
|
||||
import getpass
|
||||
from hashlib import md5
|
||||
from hashlib import md5, pbkdf2_hmac, sha256
|
||||
|
||||
from Cryptodome import Random
|
||||
from Cryptodome.Cipher import AES
|
||||
@@ -8,6 +8,21 @@ from Cryptodome.Cipher import AES
|
||||
BLOCK_SIZE = 16
|
||||
|
||||
|
||||
def random_secret_and_hash() -> tuple[str, str]:
|
||||
secret = Random.new().read(32)
|
||||
return secret.hex(), sha256(secret).hexdigest()
|
||||
|
||||
|
||||
def fake_privkey(secret: str) -> str:
|
||||
return pbkdf2_hmac(
|
||||
"sha256",
|
||||
secret.encode(),
|
||||
b"FakeWallet",
|
||||
2048,
|
||||
32,
|
||||
).hex()
|
||||
|
||||
|
||||
class AESCipher:
|
||||
"""This class is compatible with crypto-js/aes.js
|
||||
|
||||
|
||||
Reference in New Issue
Block a user