Questions tagged [cryptography]
CRYPTOGRAPHY MUST BE PROGRAMMING RELATED. Cryptography covers, among other things, symmetric and asymmetric encryption, hashing, and digital signatures. Cryptography questions not directly related to software development are better asked at crypto.stackexchange.com.
14,568
questions
-1
votes
0
answers
9
views
Cracking an XOR crypt with a know key length
I'm trying to crack a crypt with a known key length. I deduced that the operation made was a hex XOR. Here is the crypt:
...
0
votes
0
answers
29
views
How to share a message securely with a middleman
I am making a chrome extension that you can think of as anonymous google sign in. So the user needs to have a valid account and the website doesn't know anything about the user expect whether or not ...
0
votes
0
answers
10
views
openssl dgst verification - difference
I am using below test keypair and commands to sign and verify testfile.
openssl dgst -sha256 -sign privkey -out sig.sha256 testfile
openssl dgst -sha256 -verify pubkey.pem -signature sig.sha256 ...
1
vote
1
answer
25
views
How to upload a image to google-lens using python?
I'm trying to scrape google-lens with python requests but can't find the request where it uploads the image or how it is decoded.
The request (which the answer is the image-analysis) is as following:
...
-1
votes
0
answers
16
views
How do I began to start with these channel code? [closed]
What is this? We went from interest rates and annuity into this. Idk how to do this. I do not know where to start since this is the first time I have encountered this. I have zero background on coding
...
-1
votes
0
answers
18
views
Windows Server 2012 R2/2016 - ECDH Minimum Key Length Settings
Vulnerability scanner is telling me:
"(..) Key exchanges should provide at least 224 bits for Elliptic Curve Diffie Hellman key exchanges."
One entry from vulnerability scan:
"Protocol: ...
1
vote
0
answers
41
views
Is there a workaround for parsing a certificate with explicit curve params?
I have a certificate that I need to parse and verify in Go but parsing fails at x509.ParseCertificate with x509: invalid ECDSA parameters error. Here's a playground snippet.
I've found these two ...
0
votes
0
answers
12
views
What are 'officially approved' implementations to anonymize LONG values (id in table) for GDRP requirements
I want to create an anonymized version of a table where one of the id fields (long) needs to be anonymized.
The table is queried by a huge number of different business stake holders so I would prefer ...
-1
votes
1
answer
30
views
get ecc public key from x and y components in PEM format using openssl
Can I get the ecc public key from x and y components in PEM format using openssl?
X:
1d 43 15 e3 84 99 d6 f6 9f 49 61 8a ae ec f2 4f
Y:
b5 1a 86 cf f9 0e 01 af 3a 9a 52 b3 c6 58 2c 48
thank you!!...
-2
votes
0
answers
14
views
How does the Mongomery Algorithm work, and how can I implement it using {ython?
Can someone please explain to me what's the role of Montgomery reduction algorithm and how to implement it in Python. I wrote the code below to calculate a*b mod m but it doesn't seem to work well.
...
-2
votes
0
answers
22
views
Inflation Hedging Coin (IHC) - Historical data
I'm looking for python code to source Inflation Hedging Coin (IHC) historical data. Price is visible on the pages like CoinMarketCap or CoinGecko, however my every try to source this data fails. I ...
0
votes
0
answers
15
views
One authorization key with passcode and biometrics to encrypt local data on Android
I want to use one secure key to encrypt and decrypt data on device without saving it in SharedPreferences or DataStore. I want to generate that key using in app authorization (passcode and biometrics)....
0
votes
1
answer
53
views
Getting different encryption results - RSA - Java and Openssl
When I encrypt a string of text with Java and Openssl - I am unable to decrypt the cipher (using Javascript Crypto Subtle) got from Openssl, however Java cipher is decrypted (with Crypto Subtle Web ...
0
votes
0
answers
21
views
Get CADES type from existing signature in C#
Is there any ways to get CADES type from existing signature (Cades-Bes\T\XLT...)
In my project I am using BouncyCastle and System.Security.Cryptography utils
My current solution is to filter signed ...
0
votes
1
answer
63
views
How to create non-exportable private key with X509 certificate in windows key store programmatically (C#)
I am trying to create a private key and add a certificate(self-signed or signed from a CA) where I should be able to export the certificate only and make the private key non-exportable in C#. That is, ...
0
votes
1
answer
48
views
How can I securely generate the same private key in JS and PHP?
I need to create an internet-less password reset feature. My hardware uses a web (JS/HTML) interface and a PHP back-end. I've seen this in the wild before: the user gets a short key which they read to ...
1
vote
2
answers
51
views
Window Crypto Subtle : How we can use encrypt / decrypt method if we generate public private key with "RSASSA-PKCS1-v1_5" algo?
I want to use the same public-private key to do some encryption/decryption at the code level and want to send encrypted data to the backend along with my public key which I am appending inside of my ...
-3
votes
0
answers
26
views
Can I make transfers of crypto between stock markets, for example from Binance to KuCoin (using Python) [closed]
I know about libraries (python-binance python-kucoin)
But how can i do automatically transfer using python
I would be happy if you say me which library to use or which way of bypass is present
0
votes
1
answer
36
views
window.crypto.subtle.importkey and sign issue
In typescript I have the following code to sign a message with the ecdsa method and the SHA-512 algorithm.
const pem = "-----BEGIN PRIVATE KEY-----\nByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgUIcMiv/...
-1
votes
0
answers
42
views
C# AES remove trailing null characters
I'm new to the cryptography topic, so I wanted to try out AES. My problem is, that after decryption, the target buffer would have trailing '\0' characters. I guess this happens because the data is ...
0
votes
0
answers
20
views
Cryptography task for repositorium of data
The application provides the user with the option of downloading existing documents as well as
upload new documents. Each new document, before being moved to the file system, is divided into
N ...
0
votes
1
answer
38
views
What does it mean when it's said it's a "16 bit key" or "64/128 bit key"
I need some detailed explanation on the length of the key? What it means when someone says it's a 16 bit key or 128 bit key etc. The Wiki definition is "In cryptography, key size, key length, or ...
0
votes
1
answer
34
views
how do i reencrypt a aes encrypted private key generated using nodejs crypto
I tried to decrypt a private AES encrypted RSA key and re-encrypt it with the same AES algorithm, but a different password.
I used this method to create an RSA keypair:
crypto.generateKeyPairSync('rsa'...
2
votes
1
answer
49
views
Encryption with Crypto.js and pycrypto generates different encryption cipher text
I am trying to generate encrypted text in Node using Crypto.js using its AES algorithm. It works in Js for encryption and decryption both. Similarly I tried implementing same in Python using pycrypto ...
0
votes
0
answers
18
views
How to tranfer token from a wallet address to another through an api by supplying a private key? [closed]
I'm working on a website and i need and api i can use to tranfer token from my website to a personal secure wallet. How to transfer token from a wallet address to another through an api by supplying a ...
1
vote
0
answers
24
views
OpenWall BCrypt: Example of Hashing Input using crypt_r and explanation of inputs and best practice
I am struggling with finding examples for OpenWall's bcrypt implementation that use crypt_gensalt_rn and crypt_r that also explain in depth exactly what is happening in terms of input, settings etc ...
-3
votes
0
answers
33
views
How secure is Android SecretKeyFactory [closed]
So documentation never seems to explain how are keys effectively secure in the SecureKeyFactory.
I mean, if the code generates a secret using these keyspecs, what are the chances that the secret is ...
0
votes
1
answer
49
views
Implementing CRYSTALS-Kyber using BouncyCastle Java
Could anyone help lead me in the right direction to even just generate a keypair using Kyber? I've tried to search for BouncyCastle examples but I am unable to find any to go off.
I'm trying to ...
0
votes
0
answers
24
views
How to obtain public key for docker key generated by signing
If you try signing an image in a repository for the first time using docker trust sign your-repo/your-image:your-tag docker will generate 3 keys, a root key, a repository key and a signer key.. Output ...
0
votes
1
answer
34
views
How can Rfc2898DeriveBytes be both "based on HMACSHA1" and accept a hash algorithm?
The docs for Rfc2898DeriveBytes say:
Implements password-based key derivation functionality, PBKDF2, by
using a pseudo-random number generator based on HMACSHA1.
but the constructors that are not ...
0
votes
0
answers
29
views
Encrypting mulitple files with hybrid encryptions, encountering error when decrypting
Basically, i am trying to encrypt 3 files in a folder with hybrid encryption, AES CBC. Successfully encrypted all the files, but having issues decrypting. The requirements for the task is:
2 seperate ...
0
votes
0
answers
20
views
Cryptographically secure DRNG for pure js?
I am looking for a DRNG/DRBG/CSPRNG (cryptographically secure) in js. My application is currently using the web crypto api, and I am looking to use a DRNG to generate multiple, identical AES keys (...
0
votes
1
answer
74
views
RSA-CBC decrypt it using C++
I'm stuck with the problem of decrypting AES-CBC ecrypted string.
I have JS code which decrypt that string but I need do that in C++.
Key is string of SHA512 hash, and message is string of Base64.
The ...
0
votes
0
answers
27
views
How to secure an encryption key in SQL Server database
I'd like to securely store an encryption key somewhere in an SQL Server database that is only readable by internal functions and SP's. Is there a way to achieve this without it being visible to any ...
-1
votes
0
answers
27
views
Finding the kind of encryption used
I am trying to work out what kind of encryption and / or encoding is used on some data.
At first I thought it was some kind of AES CFB encryption but I can't seem to extract anything meaningful by ...
4
votes
1
answer
42
views
Blinding a message with PyCrypto in Python 3+
In Python 2, there were two methods called blind/unblind. Their docs recommend that you should now use pkcs1_15, however they only show how to sign/verify a message.
Their sample code looks like this:
...
0
votes
0
answers
29
views
RSA encryption from NodeJs Server and Decryption in Flutter App
I want to encrypt data from NodeJs Server and Decrypt it in my Flutter App.
Currently, I am using node-rsa in my NodeJs App.
I have tried several packages from pub.dev, but none can successfully ...
0
votes
0
answers
40
views
Is the output of the RSA algorithm for signing the same string the same at each time of encryption (signature) or does it change?
I am rewriting the codes written in C# with Python. In a part of the C# program, a string is signed with the RSA algorithm and sent to an API.
I have rewritten all parts of the C# program in Python, ...
0
votes
0
answers
38
views
openssl 3 does not prompt password to the user using OSSL_DECODER_from_fp()
Before openssl 3, (in openssl 1.1.1) when reading an RSA private key file, I used this function:
PEM_read_RSAPrivateKey(f, NULL, NULL, (void*)pass);
Where f is the FILE* and pass is a const char*.
If ...
0
votes
0
answers
23
views
Linux kernel crypto API callback issue
I've been trying (and struggling) to use callbacks with skciphers on the Linux kernel. Specifically, I call the function with (for example) skcipher_request_set_callback(req, 0, my_callback_function, ...
0
votes
0
answers
32
views
bybit api cant find data for my token ('VAIUSDT")
def get_price_history(symbol, interval):
session = spot.HTTP(endpoint="https://api.bybit.com")
kline = session.query_kline(symbol=symbol, interval=interval)
kline = kline['result'...
0
votes
1
answer
25
views
Why do i keep getting invalid token when i've validated that the tokens are the exact same? Cryptography Fernet : Invalid Token
So the message is supposed to be decrypted here :
def recv_message(self):
while True:
try:
data = self.socket.recv(1024)
# converting values from ...
0
votes
0
answers
37
views
How to use hard-coded keys for two parties to form key agreement using ECDH from cryptopp library as demonstration?
I need your help through This code that is an example of how to use the Crypto++ library to perform a Diffie-Hellman key exchange. The code uses the secp256r1 curve to generate the public and private ...
-1
votes
2
answers
53
views
Why do these passwords with the same salt and encryption not have the same output?
The output of the 2 variables "x" and "l" should be the same as they use the exact same salt and encrypting process.
I'd like some info on why it is not the same and how I can fix ...
0
votes
0
answers
28
views
JWK and python cryptography package - can't reproduce matching pub key
I have a JWK generated on a test website:
key = {
"kty": "EC",
"d": "MXrxKTl_o9yIQlExYy9c1LcWZX_OwX3aw-oGP0flUdo",
"use": &...
0
votes
0
answers
38
views
Difference between these two HMAC excamples?
I have to calc HMAC signature to compare to the one from a message.
I come to two different results and do not understand the difference nor which one is correct.
I have even tested different online ...
0
votes
0
answers
31
views
How to do decryption of Hill cipher for nxn matrix size in c++
So i'm tryna create a coding for the decryption of hill cipher where we have to input the key matrix and the inverse will be calculated and finally the key matrix and the plaintext will be printed out....
0
votes
1
answer
61
views
Encrypt a signed message with RSA in the cryptography Python library
I'm new to cryptography, sorry if I'm just trying to do something stupid.
So, don't hesitate to say if I tried to do something wrong or not in the right way or whatever it is.
I want to use RSA and I ...
0
votes
1
answer
65
views
Python code for generating valid BIP-39 mnemonic words for a bitcoin wallet not working
I am trying to generate valid BIP-39 mnemonic words for a bitcoin wallet in Python, but I am encountering an issue with the generated words being rejected by verification tools. I have followed the ...
-1
votes
0
answers
38
views
Public key from polygon or bnb public address?
is there a way to calculate the public key from a polygon or bnb out transaction? ( not from ethereum ), i know is there a way to calcule from ETH but i want to know if it's possible only from Polygon ...