{
  "id": "enwiki-001373261920",
  "slug": "speck-cipher",
  "title": "Speck (cipher)",
  "qid": "",
  "lead": "Speck is part of a family of lightweight block ciphers publicly released by the National Security Agency (NSA) in June 2013. Speck has been optimized for performance in software implementations, while its sister algorithm, Simon, has been optimized for hardware implementations. Speck is an add–rotate–xor (ARX) cipher. The NSA began working on the Simon and Speck ciphers in 2011. The agency anticipated some agencies in the US federal government would need a cipher that would operate well on a diverse collection of Internet of Things devices while maintaining an acceptable level of security.",
  "body": "Speck is part of a family of lightweight block ciphers publicly released by the National Security Agency (NSA) in June 2013. Speck has been optimized for performance in software implementations, while its sister algorithm, Simon, has been optimized for hardware implementations. Speck is an add–rotate–xor (ARX) cipher. The NSA began working on the Simon and Speck ciphers in 2011. The agency anticipated some agencies in the US federal government would need a cipher that would operate well on a diverse collection of Internet of Things devices while maintaining an acceptable level of security. The following is the designers' reference implementation, written in C, of the Speck variant with a 128-bit block size and key, where key = (K[1], K[0]). It is adapted from their IACR ePrint. include define ROR(x, r) ((x >> r) | (x > (64 - r))) define R(x, y, k) (x = ROR(x, 8), x += y, x ^= k, y = ROL(y, 3), y ^= x) define ROUNDS 32 void encrypt(uint64_t ct[2], uint64_t const pt[2], uint64_t const K[2]) { uint64_t y = pt[0], x = pt[1], b = K[0], a = K[1]; R(x, y, b); for (int i = 0; i Note that this code computes the round keys (key schedule) on-demand. In practice, as with other block ciphers it is common for implementations to compute the round keys just once and cache them, rather than recomputing them for every block encrypted or decrypted. Although, as the authors point out, \"Given that small code size was a major goal of the design, it made sense to reuse the round function for round key generation. This approach enables on-the-fly round key generation for microcontroller implementations, using just the round function code, very little ROM, and no RAM beyond what is required to hold the key and plaintext.\" For 16-bit words (Speck32), the rotates are 7 bits right and 2 bits left; for all other word sizes, they are 8 and 3 as shown here. If the key is more than 2 words long, there are 2 or 3 a values, which are used in rotation.",
  "categories": [
    "130386612",
    "23118434",
    "23603337",
    "24745126",
    "26025353",
    "63707111",
    "73241985"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1373261920",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1788555977.0,
  "claims": [
    {
      "id": 32267360,
      "subject_qid": "",
      "subject_slug": "speck-cipher",
      "predicate": "release date",
      "object_text": "2013",
      "object_num": 20130000.0,
      "object_unit": null,
      "polarity": 1,
      "qualifier": "",
      "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1373261920",
      "source_name": "Wikipedia",
      "source_tier": 3,
      "retrieved_at": 1792515000.8768692,
      "confidence": 0.95,
      "article_slug": "speck-cipher",
      "span_start": 64,
      "span_end": 112
    }
  ],
  "contradictions": [],
  "confidence": 0.95,
  "csl": {
    "id": "enwiki-001373261920",
    "type": "webpage",
    "title": "Speck (cipher)",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/speck-cipher",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          17
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          17
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001373261920",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1373261920",
    "note": "Immutable snapshot enwiki-001373261920"
  }
}