# What is the difference between online and offline brute force attacks?

I read some papers saying a certain scheme is secure for offline brute force attacks, but vulnerable to online brute force attacks. I wonder the difference between the online and offline brute force attacks.

• Simplest explanation is , you got a dump of /etc/password file to try all possible passwords at machine in your basement (offline). The other being you keep trying bunch of default/popular passwords at the command prompt of the server (online) until u succeed – sashank May 18 '15 at 5:48
• Something that can be attacked online but is secure offline means that the space to be searched is too large for brute force to be practical, but that the implementation offers a way to get the system under attack to answer questions, such as encrypting or decrypting an arbitrary message. Often the way it inadvertently answers is through different error responses or different timing, depending on how the test message is formed (or the decrypted version of it turns out). An example is a Padding Oracle attack, e.g. POODLE, or compressing then encrypting a message containing user-supplied data. – Steve Peltz May 18 '15 at 9:25
• offline attacks typically are limited by the resource of the attacker and have no limits set by the server, or entity you are trying to attack. If I dump a load of password files, I can guess for as long as I want, and the amount of guesses are limited to the power of my pc. If I try to guess facebook passwords by typing them into the fb server, then I am limited by fb's server(time to respond) and if fb decides to ban me because of so many incorrect guesses. – WeCanBeFriends Mar 13 '19 at 13:50
• The online attack does open up an attack vector, if the hacker can exploit a weakness in the communication between the fb server – WeCanBeFriends Mar 13 '19 at 13:51

An offline attack require work from the attacker only (or mostly), with no (or little) communication with the system (e.g. server) under attack (holding the key). An online attack requires (typically significant) work of the system under attack (including communication).

The computing power or communication bandwidth of the system under attack is typically limited compared to what a resolute attacker might use. Thus even if it requires significantly more effort, an offline attack usually is easier to perform in practice than an online attack, and stands better chance to go undetected.

Note: Online attack refers to communication with an entity under attack, that must be online (and participating) during the attack. An attack using a coalition of adversaries communicating online, with little or no communication with the entity under attack (if any), is an offline attack requiring online communication.

For example, parallel hash collision search is an offline brute-force attack. The attack against HMAC-MD5 that asks for the MAC of random messages ending with the same block until a collision is found (requiring about $$2^{64}$$ queries), then modifies the last block of the two colliding messages to (likely) get a new collision allowing a MAC forgery, is an online brute-force attack, since there is massive work involving communication with an entity capable of computing MACs (holding the key).

• Thanks, I think I somewhat understand it. Can I say, in the offline brute force attacks, the adversary (almost) brute forces by itself, while in the online brute force attacks, the adversary can launch attacks with the aid of other entities? – Jingwei May 18 '15 at 5:10
• @Jingwei: OK for that description of offline brute force attacks; for online brute force attack, what's important is that the other entitie(s) is/are what is under attack. I'll add a note to clarify. – fgrieu May 18 '15 at 5:13
• Not to mention throttling: intentional limitation of bandwidth / max number of attempts. – Ciro Santilli新疆棉花TRUMP BAN BAD Mar 6 '16 at 9:48

Online attacks involve an online entity - an entity that is available in real time to be used by an attacker. So if you attack a network service then you perform an online attack. Offline attacks are attacks that can be performed without such an entity, e.g. when an attacker has access to an encrypted file.

Online entities can perform additional security checks to make a protocol more safe. For example, an online entity can regulate the number and speed of login attempts, making dictionary attacks less feasible. However, online entities can also leak information that make a protocol less safe. An example of this are padding or plaintext oracle attacks (which can leak plaintext at a rate of 128 tries per byte).

You are however mentioning brute force attacks. Brute force attacks cannot use a padding oracle; they cannot use any data other than the result of the operation and some kind of distinguishing agent to verify the results. If they did use either of those they would not be brute force attacks anymore.

Now are there problems that could be brute forced online and not offline? The answer is yes. The easiest one to see is one where no information is available for an offline attack. An attack will of course fail if no information is present at all.

Another possibility is (perfect) forward secrecy. If a Diffie-Hellman scheme is used it may be feasible to attack the Diffie-Hellman key agreement protocol using a Brute Force attack. After setting up the session keys it may be infeasible to attack the transport security though. (DH is just used as an example here, I'm not referencing a specific attack.)

In the context of algorithms, the terms online sometimes refers to working on a stream of the input data. To be more precisely: the whole data set is unknown at the time the algorithm starts. So your algorithm has to take decisions that might be wrong. Heuristics and approximation are part of these.

Offline algorithms instead work on the full data set, that is available from the beginning.

• Yes; but that's typically not the meaning of online in cryptography, as understood in online brute-force attack. – fgrieu May 18 '15 at 8:09