Browse the glossary using this index

Special | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ALL

D

Picture of Yee Wei Law

Data flow analysis

by Yee Wei Law - Sunday, 14 May 2023, 1:19 PM
 

This continues from discussion of application security testing.

Data flow analysis is a static analysis technique for calculating facts of interest at each program point, based on the control flow graph representation of the program [vJ11, p. 1254].

A canonical data flow analysis is reaching definitions analysis [NNH99, Sec. 2.1.2].

For example, if statement is x := y◻z, where is any operator, and x is defined at statement .

Reaching definitions analysis determines for each statement that uses variable x which previous statement defined x.

Example 1 [vJ11, pp. 1254-1255]
In the example below, the definition x at line 1 reaches line 2, but does not reach beyond line 3 because x is assigned on line 3.
1 x := y + z;
2 w := x + z;
3 x := w;

More formally, data flow analysis can be expressed in terms of lattice theory, where facts about a program are modelled as vertices in a lattice.

The lattice meet operator determines how two sets of facts are combined.

Given an analysis where the lattice meet operator is well-defined and the lattice is of finite height, a data flow analysis is guaranteed to terminate and converge to an answer for each statement in the program using a simple iterative algorithm.

A typical application of data flow analysis to security is to determine whether a particular program variable is derived from user input (tainted) or not (untainted).

Given an initial set of variables initialised by user input, data flow analysis can determine (typically an over approximation of) all variables in the program that are derived from user data.

References

[NNH99] F. Nielson, H. R. Nielson, and C. Hankin, Principles of Program Analysis, Springer Berlin, Heidelberg, 1999. https://doi.org/10.1007/978-3-662-03811-6.
[vJ11] H. C. van Tilborg and S. Jajodia (eds.), Encyclopedia of Cryptography and Security, Springer, Boston, MA, 2011. https://doi.org/10.1007/978-1-4419-5906-5.

Picture of Yee Wei Law

Delay-tolerant networking (DTN)

by Yee Wei Law - Monday, 22 May 2023, 10:58 PM
 

In a mobile ad hoc network (MANET, see Definition 1), nodes move around causing connections to form and break over time.

Definition 1: Mobile ad hoc network [PBB+17]

A wireless network that allows easy connection establishment between mobile wireless client devices in the same physical area without the use of an infrastructure device, such as an access point or a base station.

Due to mobility, a node can sometimes find itself devoid of network neighbours. In this case, the node 1️⃣ stores the messages en route to their destination (which is not the node itself), and 2️⃣ when it finds a route of the destination of the messages, forwards the messages to the next node on the route. This networking paradigm is called store-and-forward.

A delay-tolerant networking (DTN) architecture [CBH+07] is a store-and-forward communications architecture in which source nodes send DTN bundles through a network to destination nodes. In a DTN architecture, nodes use the Bundle Protocol (BP) to deliver data across multiple links to the destination nodes.

Watch short animation from NASA:

Watch detailed lecture from NASA:

References

[CCS15] CCSDS, CCSDS Bundle Protocol Specification, Recommended Standard CCSDS 734.2-B-1, The Consultative Committee for Space Data Systems, September 2015.
[CBH+07] V. Cerf, S. Burleigh, A. Hooke, L. Torgerson, R. Durst, K. Scott, K. Fall, and H. Weiss, Delay-tolerant networking architecture, RFC 4838, April 2007.
[IEH+19] D. Israel, B. Edwards, J. Hayes, W. Knopf, A. Robles, and L. Braatz, The Benefits of Delay/Disruption Tolerant Networking (DTN) for Future NASA Science Missions, in 70th International Astronautical Congress (IAC), October 2019. Available at https://www.nasa.gov/sites/default/files/atoms/files/the_benefits_of_dtn_for_future_nasa_science_missions.pdf.
[PBB+17] J. Padgette, J. Bahr, M. Batra, M. Holtmann, R. Smithbey, L. Chen, and K. Scarfone, Guide to Bluetooth Security, NIST Special Publication 800-121 Revision 2 Update 1, May 2017. https://doi.org/10.6028/NIST.SP.800-121r2-upd1.
[SB07] K. Scott and S. Burleigh, Bundle protocol specification, RFC 5050, November 2007.

Picture of Yee Wei Law

Differential power analysis

by Yee Wei Law - Wednesday, 26 April 2023, 9:49 AM
 

Kocher et al. [KJJ99] pioneered the method of differential power analysis (DPA).

A power trace is a set of power consumption measurements taken over a cryptographic operation; see Fig. 1 for an example.

Fig. 1: A sample power trace of a DES encryption [KJJ99, Figure 1], which is clearly indicative of the 16 rounds of the Feistel structure.

Let us define simple power analysis (SPA) before we get into DPA. SPA is the interpretation of direct power consumption measurements of cryptographic operations like Fig. 1.

Watch a demonstration of SPA:

Most hard-wired hardware implementations of symmetric cryptographic algorithms have sufficiently small power consumption variations that SPA cannot reveal any key bit.

Unlike SPA, DPA is the interpretation of the difference between two sets of power traces.

More precisely, this difference is defined as

where

  • is the number of traces;
  • is the time index;
  • is the selection function which for the DES (see Figs. 2-3) is defined as the value of bit () of the DES intermediate (see input to block E in Fig. 3) at the beginning of the 16th round for ciphertext when is the 6-bit subkey entering the S-box corresponding to bit ;
  • is the th power trace (vector of power values).

Note each trace is associated with a different ciphertext.

Fig. 2: The Feistel structure of DES, where F denotes the Feistel function (see Fig. 3).

Fig. 3: The Feistel function of DES, where E denotes the expansion permutation that expands a 32-bit input to 48 bits.

During decryption of , denotes the half block (32 bits).

If bit enters S-box S1, then is the 6-bit subkey that enters S-box S1.

DPA was originally devised for DES but it can be adapted to other cryptographic algorithms.

DPA uses power consumption measurements to determine whether a key block guess is correct.

  • There are only possible values of .
  • When the attacker’s guess of is incorrect, the attacker’s value of differs from the actual target bit for about half of the ciphertexts ; equivalently, the selection function is uncorrelated to what was actually computed by the target device, i.e., .
  • When the attacker’s guess of is correct, is correlated to the value of the bit manipulated in the 16th round, i.e.,

    • approaches the effect of the target bit on the power consumption as , where is the time index corresponding to when   is involved in computation;
    • approaches zero for all the times when is not involved in computation.
  • Fig. 4 shows four sample power traces (1 simple, 3 differential).
Fig. 4: From top to bottom: a simple power trace, a differential trace with a spike indicating correct guess, two differential traces for incorrect guesses [KJJ99, Figure 4]. for the differential traces.

References

[KJJ99] P. Kocher, J. Jaffe, and B. Jun, Differential power analysis, in Advances in Cryptology — CRYPTO’ 99 (M. Wiener, ed.), Springer Berlin Heidelberg, Berlin, Heidelberg, 1999, pp. 388–397. https://doi.org/10.1007/3-540-48405-1_25.

Picture of Yee Wei Law

Diffie-Hellman key agreement

by Yee Wei Law - Tuesday, 30 May 2023, 11:21 PM
 

The Diffie-Hellman (D-H) key agreement (often called “key exchange”) protocol is standardised in NIST SP 800-56A [BCR+18].

The protocol originated in the seminal 1976 paper by Whitfield Diffie and Martin Hellman [DH76], both recipients of the 2016 Turing Award (their contribution took 40 years to be recognised).

Protocol between 👩 Alice and 🧔 Bob [KL21, CONSTRUCTION 11.2] in Fig. 1:

  1. On input of security parameter , 👩 Alice runs probabilistic polynomial-time (PPT) algorithm to obtain the domain parameters , where is a cyclic group of prime order , and is a generator of .

    The bit-length of = the security parameter .

    The domain parameters can be pre-distributed.

  2. 👩 Alice chooses , , uniformly at random, and computes .

    is the (cyclic) group of integers modulo .

    👩 Alice’s (ephemeral) private key and public key are and respectively.

  1. 👩 Alice sends to 🧔 Bob.
  2. 🧔 Bob chooses , ,  uniformly at random, and computes .

    🧔 Bob’s (ephemeral) private key and public key are and respectively.

  3. 🧔 Bob sends to 👩 Alice and outputs .
  4. 👩 Alice computes .

Successful completion of the protocol results in the session key .

Fig. 1: The D-H key agreement protocol [KL21, FIGURE 11.2].

A necessary condition for preventing a probabilistic polynomial-time (PPT) eavesdropper from computing the session key is that the computational Diffie-Hellman (CDH) problem is hard:

Definition 1: Computational Diffie-Hellman (CDH) problem [Gal12, Definition 20.2.1]

Given the triple of elements of , compute .

However, the hardness of the CDH problem is not sufficient.

Just as indistinguishability plays an essential role in symmetric-key encryption, indistinguishability is key here: if the session key is indistinguishable from an element chosen uniformly at random from , then we have a sufficient condition for preventing a PPT eavesdropper from computing the session key [KL21, pp. 393-394].

The indistinguishability condition is equivalent to the assumption that the decisional Diffie-Hellman (DDH) problem is hard:

Definition 2: Decisional Diffie-Hellman (DDH) problem [Gal12, Definition 20.2.3]

Given the quadruple of elements of , determine whether or not.

The DDH problem is readily reducible to the CDH problem, since any algorithm that solves the CDH can compute and compare it with ; implying the DDH problem is no harder than the CDH problem.

In turn, the CDH problem is reducible to the discrete logarithm problem (DLP, see Definition 3), since any algorithm that solves the DLP can compute from , from , and hence ; implying the CDH problem is no harder than the DLP problem.

Definition 3: Discrete logarithm problem (DLP) [Gal12, Definition 13.0.1]

Given , where is a multiplicative group, find such that .

In other words, the DDH problem can be reduced to the CDH problem, which in turn can be reduced to the DLP; solving the DLP breaks the D-H key agreement protocol.

There are multiplicative groups for which the DLP is easy, so it is critical that the right groups are used.

A safe-prime group is a cyclic subgroup of the Galois field with prime order , where is called a safe prime; this subgroup has elements [BCR+18, Sec. 5.5.1.1].

NIST [BCR+18, Appendix D] refers to RFC 3526 and RFC 7919 for definitions of safe-prime groups.

The D-H key agreement protocol is used in the Internet Key Exchange (IKE) protocol, which is currently at version 2 [KHN+14].

References

[BCR+18] E. Barker, L. Chen, A. Roginsky, A. Vassilev, and R. Davis, Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography, Special Publication 800-56A Revision 3, NIST, April 2018. https://doi.org/10.6028/NIST.SP.800-56Ar3.
[DH76] W. Diffie and M. Hellman, New directions in cryptography, IEEE Transactions on Information Theory 22 no. 6 (1976), 644–654. https://doi.org/10.1109/TIT.1976.1055638.
[Gal12] S. D. Galbraith, Mathematics of Public Key Cryptography, Cambridge University Press, 2012. https://doi.org/10.1017/CBO9781139012843.
[KL21] J. Katz and Y. Lindell, Introduction to Modern Cryptography, 3rd ed., CRC Press, 2021. Available at https://ebookcentral.proquest.com/lib/unisa/detail.action?docID=6425020.
[KHN+14] C. Kaufman, P. E. Hoffman, Y. Nir, P. Eronen, and T. Kivinen, Internet Key Exchange Protocol Version 2 (IKEv2), RFC 7296, October 2014. https://doi.org/10.17487/RFC7296.