Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Cryptography is the practice and study of logical means used to achieve information confidentiality, integrity and authenticity. It covers, among other things, encryption (making some data unreadable except for those who know a given secret element, called a key), data hashing (in particular for ...

0
votes
1answer
43 views

Public / Private Key Cryptography for offline systems

Are there any best practices around distributing an encrypted package to multiple end user systems, specially if the end system are offline ones, in context of asymetric cryptography? Is it a must to ...
2
votes
1answer
61 views

Sign a lot of messages with same private key

I'm creating platform where I need to sign a lot of messages (1k/sec), I want to use Ed25519 signature, because it has the best performance. Is it safe to sign that many messages with the same private ...
0
votes
0answers
23 views

How large is AppEngine's Private Key?

AppEngine provides methods for signing binary data - e.g. via the Go language's SignBytes[1] However, it doesn't specify any information about how large the private key is. Is this published ...
1
vote
1answer
38 views

AEAD and nonces explained in layman's terms (Symmetric encryption example using Libsodium)

After almost 4 days of work, I've finally gotten Libsodium crypto_aead_xchacha20poly1305_ietf_encrypt to work and produce the same result in JavaScript and PHP. But I'm confused. The PHPDoc ...
1
vote
1answer
55 views

Understanding ANSI/AAMVA encoded data (pdf417 data matrix) on back of NYS ID card

Background I am developing an Android application for work which runs on a Zebra TC51 bar code scanner, which I have been playing around with.. I scanned my NYS drivers license and inspected the ...
2
votes
2answers
42 views

Can be used ECDH with static public key and parameters?

I have protocol required for privacy. Thus, I want to use hybrid cryptography. Base on my knowledge, ECDH is fast and secure. My system consists of 3 main components a trusted-server, client, and ...
71
votes
5answers
14k views

What makes Random Number Generators so fragile?

It seems to me that a hardware component which generates random numbers is extremely simple - just measure tiny vibrations in the hardware with a sensor, right? Maybe I'm wrong but it seems like if ...
0
votes
2answers
62 views

Cryptography as an ecosystem

I was thinking about a thought experiment. Let's imagine a world full of crackers such that whenever you encrypt something there will be someone who will try to crack your cryptographic key through ...
0
votes
1answer
83 views

Why use a separate key exchange method like DH during the TLS handshake [duplicate]

Ok first off I'm very familiar with the TLS handshake, the purpose of PKI and key exchange methods. My question is why use a complicated key exchange method like Diffie Hellman when the client could ...
0
votes
1answer
69 views

HSM (Hardware Security Module) [closed]

I am implementing a security solution and I would like some recommendations on existing HSM software. If anyone has done a comparison on the existing HSM software and can recommend good and supported ...
-2
votes
1answer
74 views

How are replay attacks prevented? [closed]

I imagine it’s due to time stamps and sequence numbers. However, those can be replayed as well. The attacker can't create new sequence numbers or time stamps without being detected if the integrity ...
2
votes
2answers
60 views

Why rekey long-lived connections?

Why is rekeying after a certain period of time, or after a certain volume of data transfer, often implemented in modern secure transport protocols such as ESP or TLS? What are the security risks of ...
-6
votes
1answer
139 views

LTE Security: What kind of cryptograpy could be used to fix layer 2? [closed]

New attacks on LTE: https://thehackernews.com/2018/06/4g-lte-network-hacking.html https://www.alter-attack.net/media/breaking_lte_on_layer_two.pdf Layer two (data link) does not guarantee the ...
1
vote
2answers
127 views

Bcrypt data type and length?

I'm using the following library for hashing my password. string password = BCrypt.Net.BCrypt.HashPassword("stackoverflow"); The length is apparently 60 each time. My question is, I'm planning to ...
0
votes
1answer
75 views

How to securely handle a login system [duplicate]

I'm making a desktop application in C# and I want to know If I'm handling this (from security perspective) as should be or not. My Users table have both hashed_password and salt, both are binary(32). ...
1
vote
1answer
56 views

What function is used to generate client random in TLS

I've been learning TLS. During the Client-Server Hello their random values are shared. The client generates a 28 byte random and combine it with 4 bytes of epoch time to generate a 32 byte random ...
0
votes
1answer
41 views

Trustable Sources For Security Algorithms and Standards?

I am learner of cryptographic algorithms and security standards. I usually Google it to understand the basics of the algorithm or the protocol, and to find an implementation of a protocol. However I ...
2
votes
2answers
155 views

If the cypher-text, plain-text and nonce is known, can the secret key be determined?

I'm using the sodium_crypto_secretbox and sodium_crypto_secretbox_open functions in PHP (currently PHP 5.6, using paragonie/sodium_compat). If a user has cypher text, nonce and decrypted plain text, ...
1
vote
2answers
63 views

Reason for not implementing own algorithms/implementations [duplicate]

I get that people don't want to encourage other people to implement their own algorithms/implementations of algorithms due to safety issues. But on the other hand, questions about creating your own ...
1
vote
1answer
58 views

How to reverse engineer str_shuffle (PHP) to get its mt_rand outputs

$output = str_shuffle("12345"); E.g. $output is now 25134 How do I find out what numbers came out of mt_rand() to allow for the shuffle I want to know this because I want the seed of mt_rand() and ...
1
vote
1answer
59 views

OpenSSL unable to verify certificate issued by local CA

We have an application that issues (and maintains) SSL certificates for various uses. It does this using the Bouncycastle library in .NET. We create a CA cert, and then use this certificate to ...
-4
votes
2answers
75 views

Private Blockchain VS regular Public-key cryptography [closed]

Private Blockchain (permissioned) VS regular Public-key cryptography: What is the need and add-value of a private blockchain (permissioned) if one can use normal regular public-key cryptography?
0
votes
1answer
112 views

Amazon AWS KMS - Concept of signing in general and with JWT

Looking into Amazon AWS KMS (Key Management System). Got confused since the methods exposed via Amazon AWS API are only to encrypt and decrypt (https://docs.aws.amazon.com/kms/latest/APIReference/...
0
votes
0answers
32 views

Why do we need to hash passwords? [duplicate]

I understand that it's to protect the user credentials but my question is, If the hacker managed to get access to our database, what difference would it make? Let's give an example with facebook for ...
1
vote
1answer
363 views

How can I use openssl to decrypt AES-encrypted data using the key and initialization vector?

I am attempting to follow the example in this question: Where is the salt on the OpenSSL AES encryption? but I'm having some trouble decrypting using the key and initialization vector. When I ...
-1
votes
2answers
68 views

App to prove that an image is not edited

I want to prove that a photo I will take has not been edited. So I am planning to implement an open source app which uses a "strict image authentication" technique using private key cryptography as ...
5
votes
1answer
83 views

TLS1.2 AES 128 CBC Encrypted Data size

I know that TLS ciphers such as TLS_RSA_WITH_AES_128_CBC_SHA transmit data as shown. From my understanding, the ciphertext must be a multiple of the block size, which in this case is 16 bytes. However,...
1
vote
1answer
294 views

How to encrypt data in frontend/backend with a key that is not stored anywhere and is only known to owner?

I have read bunch of answers and tutorials on how client side cryptography is not a good idea because of many reasons listed mainly in Javascript Cryptography Considered Harmful article. Some facts ...
1
vote
0answers
48 views

BadPaddingException when using the textbook cipher

I'm using an implementation as below to do an encryption where the bouncycastle is used as the crypto provider. So the ciphertext for a particular plaintext will not be dynamic as the RSA from ...
3
votes
2answers
183 views

Can AES and SHA-256 outputs with the same inputs be used to break each other?

An abstract representation of my question looks like this: byte[] encrypted = AES.Encrypt(bytesToEncrypt, password); byte[] hash = SHA256.Hash(password); If an attacker obtains the values of both ...
3
votes
1answer
118 views

Bruteforce FileVault Encryption?

I've been getting into forensics and penetration testing lately and hoping someone can explain what the below data is and how it might be used to perform a bruteforce (hashcat) attacks against ...
1
vote
2answers
106 views

JWT encoding using HMAC with asymmetric key as secret

I'm currently exploiting the vulnerability discussed here https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ Where the algorithm type in JWT can be changed from ...
1
vote
1answer
116 views

JSON web token vulnerability with HMAC and RSA

I'm currently learning about a vulnerability that takes advantage of a JSON web token which is discussed here Though I understood the nature of the bug and how it can be abused by attackers, I couldn'...
2
votes
1answer
5k views

MTproto Proxy Security in Telegram App

In Telegram messenger, latest update, there is an option to set connection type to MTProto Proxy. Note: There is a detailed description by Telegram team on MTProto. Now telegram officially ...
2
votes
1answer
83 views

How does a client (like SSLLabs) know all the cipher suites a server supports if the server doesn’t send it’s list of supported cipher suites?

I was looking at the TLS handshake and I noticed that the client will send it's list of supported cipher suites and the server will select a cipher suite. The server never sends it's list of supported ...
98
votes
16answers
22k views

Security BY obscurity is horrible. Is security AND obscurity good?

Normally I preach that rolling your own custom crypto algorithm is a bad idea. But will it really hurt if it's the outermost layer though? Or will it make security worse? AES -> CipherText ->...
0
votes
1answer
73 views

Key length greater than block size

I am new to infosec and am recently study cryptography. In AES, if i have 192-bit key to encrypt 128-bit block size, won't it only be using the first 128-bit of my 192-bit key?? So what's that extra ...
1
vote
0answers
47 views

Non-invasively forcing reauthentication in Bluetooth 2.1

Is it possible for an unauthenticated bystander to force reassociation/reauthentication of a pair of Bluetooth 2.1 devices in a manner similar to IEEE 802.11i deauths? Bluetooth 2.1 (BR/EDR) uses ...
1
vote
1answer
54 views

If we use only client nonce and not server nonce, which attack vectors become possible?

As we all know, nonce is needed to prevent replay attacks. Everywhere I read about nonce, I see that client always fetches one from the server, and, to improve security even more, it also can add its ...
16
votes
2answers
1k views

Is “always use /dev/urandom” still good advice in an age of containers and isolation?

In short: Instead of another question asking about when to use /dev/random instead of /dev/urandom, I present the following scenario, in which I find myself in an application I'm building: A VM or ...
3
votes
1answer
177 views

What is properly way to manage and remove symmetric key in C#

If I have a symmetric key in a byte[] array in C#, how can I erase it securely? for (int i = 0; i < array.Length; i++) { array[i] = 0; } Is this good enough?
1
vote
0answers
74 views

Why WPA2 did not design a PTK based on asymmetric cryptography?

I was shocked to learn how the PTK is crafted from the PMK in WPA2 WiFi. PMK is made with crypt_hash(SSID + PSK). OK, seems good. Then, the client and the Access Point (AP) make the famous 4 way ...
0
votes
0answers
38 views

RSA/ECB/PKCS1Padding transformation

Is it secure to use RSA/ECB/PKCS1Padding transformation (with no parameters)? I found that padding oracle attack can be performed against the RSA with PKCS1Padding. I use this algorithm to encrypt ...
0
votes
0answers
27 views

Rest service Password securing [duplicate]

I have a REST service A, which communicates with REST service B (both are internally hosted within the company network). REST service B is accessed via a service ID & plain password. How do I ...
-1
votes
1answer
201 views

AES-CBC then SHA vs AES-GCM for encrypting and authenticating a web token

I am trying to have something like JWT but kinda ad hoc and encrypted. The token itself is simply a stringified JSON that contains the user id and unix timestamp. Now, I tried to use AES-128-GCM, ...
-4
votes
1answer
63 views

How Secret is splitted in Shamir Algorithm [closed]

I have been reading about the Shamir Secret Sharing algorithm. While researching I am still not sure how a secret is split. So let's suppose we follow example given here. The secret is 1234 and we ...
3
votes
2answers
299 views

Change the function such that there are no more side-channels

Given is the function compareKey which is a part of a crackme (a binary file). Which side-channel attack can be used to find the right password (password is made up by ASCII coded big and small ...
0
votes
2answers
181 views

Is there a difference between encryption keys and encryption certificates?

Learning about cryptography. Experimenting with attacking the algorithm it's self. My question regards vocabulary basically. Are encryption keys and certificates the same thing or are they different? ...
0
votes
1answer
43 views

In openssl cipher suites, does AES128 imply AES128-CBC if another mode is not explicitly mentioned?

For example (from openssl ciphers -v), for AES128, the output: AES128-SHA256 TLSv1.2 Kx=RSA Au=RSA Enc=AES(128) Mac=SHA256 is given. Does Enc=AES(128) imply AES(128)-CBC? I am inclined to believe ...
1
vote
0answers
46 views

BREACH attack against SPA

I have a single page application that is hosted at example.com that relies on api.example.com. The SPA sends user credentials (JWT token) in authorization header for every request. Let's suppose ...