Stack Exchange Network

Stack Exchange network consists of 175 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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [timing-attack]

The tag has no usage guidance.

11
votes
5answers
3k views

Are variable time comparisons always a security risk in cryptography code?

I came across the cryptography python package, and noticed it had the following about reporting security vulnerabilities: Examples of things we wouldn’t consider security issues: Using a variable ...
-1
votes
1answer
221 views

Timing Attacks: Against PHP Server - Prevention/Tutorials [duplicate]

What is the most simple and effective way to Prevent the Timing attacks for the programmers who use PHP? I'm a high school student, I'm new to programming and I've been learning Security since few ...
3
votes
2answers
304 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 ...
5
votes
2answers
319 views

What “timing attacks” could websites perform using last modified dates of files?

https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified describes the .lastModified property of a File object in JavaScript (usually created when a user selects a file via a HTML <input ...
9
votes
3answers
584 views

Are there any successful cases of timing attacks over the internet?

Potential timing attacks are always brought up in one context or the other but I don't think I've ever read a case where someone has actually executed such an attack over the internet.
2
votes
1answer
76 views

Are there techniques or methods to develop security protocols without side channel attacks?

In general timing attacks are a manifestation of the implementation. So if I am processing data on the server or the client then I can leak information depending on how the code is written. To ...
11
votes
1answer
563 views

Why does this cache attack work?

I was recently reading the following paper about doing a cache attack in Javascript: https://arxiv.org/pdf/1502.07373v2.pdf But I was confused by how it could work. In the paper, an 8 MB buffer was ...
0
votes
1answer
131 views

Are there any mechanisms in TLS 1.2 protocol against timing attacks?

Are there any mechanisms in the TLS 1.2 protocol (not implementation) against timing attacks? For example, that the handshake response time should be padded to X milliseconds? Or should I implement ...
0
votes
2answers
291 views

Is sql where queries in authentication prone to timing attacks, if one or no database rows are returned?

Say I have this code for authentication. $me = mysql_query("SELECT * from users WHERE id='$_COOKIE[userid]' && password ='$_COOKIE[pass]'") or die (mysql_error()); $me = ...
3
votes
1answer
627 views

SecureString how to compare against another SecureString that is safe against Timing Attacks?

I see Microsoft provide a SecureString: https://msdn.microsoft.com/en-us/library/system.security.securestring(v=vs.110).aspx, is it possible to compare two SecureStrings and ensure it is safe against ...
37
votes
3answers
7k views

Why should memcmp not be used to compare security critical data?

From man 3 memcmp: Do not use memcmp() to compare security critical data, such as cryptographic secrets, because the required CPU time depends on the number of equal bytes. Instead, ...
3
votes
1answer
92 views

Is DNSSEC vulnerable to (remote) timing attacks?

I wondered if DNSSEC would be vulnerable to (remote) timing attacks, unlike TLS, signatures don't have to be recalculated each time. So how would you be able to exploit timing information in the first ...
1
vote
0answers
463 views

Why does the order of arguments to hash_equals() matter?

The documentation for PHP’s hash_equals() (a string comparison function which is safe from timing attacks) says, It is important to provide the user-supplied string as the second parameter, rather ...
1
vote
1answer
709 views

Are timing attacks for PHP used in practice? [duplicate]

I'm curious, to what extent are passwords exploitable if the underlying password comparison is vulnerable to timing attacks. My main concern is that internet speed continuously varies, webserver ...
2
votes
2answers
214 views

How can ssh defend against timing analysis attacks? [duplicate]

Along the lines of electrical usage revealing what TV show is playing, ssh timing attacks could reveal kinds of traffic, such as streaming video or even what specific video is being streamed. This ...
1
vote
1answer
232 views

MAC Timing Attack Xbox 360

I was reading my textbook, Katz and Lindell's Intro to Modern Cryptography in the section about Message Authentication Codes. They were talking about timing attacks in general and brought up an ...
1
vote
5answers
359 views

Does disclosing server local time to users cause any security risks?

I need to implement a number of web pages for resetting an API access key: user must be logged in first user gets to "confirmation" page that has a "confirmation" link with a time token inserted user ...
7
votes
4answers
426 views

Simple defense against power analysis?

I would like to hear your opinions and how effective would my proposed defense is against power analysis. It is one of the nastiest side channel attacks because it's undetectable and passive, but ...
1
vote
1answer
133 views

Short integer hashes to mitigate timing attacks on passwords

Assuming we want to protect against timing attacks on our hashed passwords because even to know the hash may give to the attacker a significative advantage then we may want to perform a constant-time ...
19
votes
2answers
2k views

Principles of cache attacks

There are many scientific publications that deal with cache attacks. Most recently, the CacheBleed attack was published which exploits cache bank conflicts on the Intel Sandy Bridge architecture. Most ...
7
votes
1answer
62 views

Is flushing of all caches on any context switch between mutually-distrusting processes the only way to prevent cache timing attacks?

This article demonstrates a devastating Javascript-based cache timing attack that allows for cross-VM tracking of mouse movements and other activities by web pages. Is the only way to prevent cache-...
4
votes
0answers
114 views

Are there any C++ STL alternatives which is bulletproof against timing attack?

Just out of curiosity, I wonder if there are any packages of popular algorithm/data structures which are secure against timing attack. I think GNU libstdc++ std::string::compare(), std::unordered_map ...
3
votes
1answer
119 views

Can timing attacks over a webservice be eliminated by standardizing the time it takes to return a request?

For example, would this (pseudo)-code work? let t = timeRightNow() let message = stuffWhoseTimingCantBeLeaked() waitUntilTime(t+1 second) send message Or similar? That way the time that the message ...
3
votes
1answer
6k views

Covert, Overt, and side channels

I am really confused between the following three terms: Overt Channel. Covert Channel. Side-Channel. I feel frustrated! I've been searching about them to find a clear explanation but I keep getting ...
1
vote
1answer
2k views

Timing side-channel attack example

I understand that timing side-channel attack is a measurement of time taken to execute cryptographic algorithms. I'd like to see a simple example that explains how timing attack takes a place on any ...
3
votes
2answers
315 views

Cross-language primitives against string comparison timing attacks?

Related, not a duplicate: Timing Safe String Comparison - Avoiding Length Leak I know about cache misses, let's assume we fit in a cache line swimmingly. Thomas' excellent answer doesn't talk about ...
1
vote
1answer
31 views

Usefulness of Server's Work Load given Timing Attack Resistance of Responses

I've read articles in the past discussing the importance of having timing attack resistant responses for information where knowing the time for evaluation would leak information about the data being ...
37
votes
8answers
6k views

Should I worry about remote timing attacks on string comparison? [duplicate]

Say we have a Java web application which uses a shared secret to verify the identity of the client. The secret is stored on the server, and the client transmits the secret over SSL where it is checked:...
5
votes
2answers
634 views

When can you not use strcmp?

I've read that one shouldn't use strncmp(userSuppliedPassword,origPassword,sizeOfArray) (or String.equals in Java) since one can use a timing attack to guess the password. Rather, one should use a ...
3
votes
0answers
572 views

SQL security - ACID transactions and locking to prevent financial fraud (timing attack?) [closed]

I am trying to prevent something similar to this from happening: http://hackingdistributed.com/2014/04/06/another-one-bites-the-dust-flexcoin/ Basically the financial exchange was using non-ACID ...
15
votes
7answers
3k views

Mitigate timing attack threat against password recovery page

We recently had an external security review performed on a public-facing website we manage. They noted that on the "recover password page", there are different response times when providing existing ...
-3
votes
1answer
69 views

What threats involve in cache miss

What are the possible consequences of a cache miss? In other word, is it possible that a cache miss could cause a security threat? Thank you.
10
votes
2answers
2k views

Can I prevent timing attacks with random delays?

I read recently about profiling for valid user accounts with timing attacks, IE the application-under-attack takes a predictably different amount of time to process say a login on a non-existent user ...
7
votes
1answer
648 views

PHP bin2hex vulnerable to timing attack?

I've read in a few places[1][2][3] of the desire to make PHP's bin2hex constant time. In what scenarios would bin2hex be vulnerable to a timing attack? Is this below code for handling a CSRF token ...
-1
votes
1answer
128 views

Are there security implications to not installing the Leap Second patch on Red Hat systems? [closed]

What are Leap Seconds? A leap second is a second which is added to Coordinated Universal Time (UTC) in order to synchronize atomic clocks with astronomical time. The reason we have to add a second ...
7
votes
2answers
605 views

How to slow down program execution

I have a simple executable binary. It takes as input a user supplied string and compares it with a private string using strcmp. How can I slow down the execution of this program such that I can launch ...
4
votes
0answers
161 views

What is the state of the art in internet timing attacks? [closed]

What is the shortest timing difference resolved by a timing attack demonstrated over the internet (not just a LAN)? This paper from 2009 suggests 15µs. By how much has that number improved?
3
votes
2answers
378 views

Are string comparson timing attacks practical over public networks

Related are-there-any-working-proof-of-concept-string-comparison-timing-attacks I was looking at doing some encryption and hashing in PHP and came across this note Please be careful when ...
14
votes
3answers
11k views

Simple string comparisons not secure against timing attacks [duplicate]

As I learned in a comment for How to encrypt in PHP, properly?, I was told using a string comparison like the following in PHP is susceptible to timing attacks. So it should not be used to compare two ...
1
vote
3answers
1k views

Constant time compares when array sizes are not equal?

What is the preferred or recommended way to pursue contestant time compares when array lengths are not equal? Should we exit as early as possible? Something like: if (array1.size() != array2.size()) ...
16
votes
2answers
3k views

Timing attack against HMAC in authenticated encryption?

In an answer to another question of mine, it was noted that a class using standard string comparison functions when checking the HMAC in authenticated encryption would make the class vulnerable to ...
4
votes
1answer
166 views

Timing attacks in managed code

I have heard that running code in a managed language, e.g. Java in the JVM, is impossible to protect against timing attacks due to the JITing nature of most managed runtimes. In concept I can agree ...
1
vote
2answers
899 views

Timing-safe string comparison in high-level languages

I'm looking for a reliable solution to compare two strings without leaking their content through time differences. The length of the strings is not secret. The background is this: I'm implementing ...
0
votes
0answers
32 views

Length-constant password comparison in scrypt? [duplicate]

E.g.: XORing the candidate against stored then comparing against 0. Do I need to worry? (my question is much in the same style as this question: Does bcrypt compare the hashes in "length-...
7
votes
1answer
249 views

Deanonymizing users by introducing structured delays to the network?

Here is a scheme for deanonymizing a user that I've been thinking about, just out of curiosity. I tried searching for it but didn't find much. Does this technique have a name? Are there any papers or ...
0
votes
1answer
254 views

Timing Attacks in RSA

Considering the classic scenario of Eve trying to listen in to Alice and Bob's conversation, if Eve can intercept messages between Alice and Bob but with no access to their computers would Timing ...
5
votes
1answer
2k views

Are there any working proof-of-concept string comparison timing attacks?

I've tried to reproduce a string comparison timing oracle in two languages (Java and Python), but I'm not seeing any correlation in the timing based on the input into the comparison. Are there any ...
20
votes
5answers
3k views

Timing Safe String Comparison - Avoiding Length Leak

Let's say that we're building a generic timing-safe comparison function for general purpose use. Making it so that it is safe when both strings are equal length is pretty well known. However, what I'm ...
18
votes
2answers
2k views

How does SSH defend against keystroke-timing attacks?

This paper: https://www.usenix.org/legacy/events/sec01/full_papers/song/song.pdf Explains how SSH can be compromised by analyzing the timing of the keystrokes to guess what the user is typing. It's ...
11
votes
2answers
5k views

Does bcrypt compare the hashes in “length-constant” time?

I saw this function slowEquals() while reading Salted Password Hashing - Doing it Right, which uses a byte-level xor comparison to avoid timing attacks. I was wondering whether this is what Bcrypt ...