Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Symmetric-key algorithm
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Algorithm}} [[File:Simple symmetric encryption-en.svg|thumb|upright=1.3|Symmetric-key encryption: the same key is used for both encryption and decryption|class=skin-invert-image]] '''Symmetric-key algorithms'''{{efn|Other terms for symmetric-key encryption are ''secret-key'', ''single-key'', ''shared-key'', ''one-key'', and ''private-key'' encryption. Use of the last and first terms can create ambiguity with similar terminology used in [[public-key cryptography]]. Symmetric-key cryptography is to be contrasted with [[asymmetric-key cryptography]].}} are [[algorithm]]s for [[cryptography]] that use the same [[Key (cryptography)|cryptographic keys]] for both the encryption of [[plaintext]] and the decryption of [[ciphertext]]. The keys may be identical, or there may be a simple transformation to go between the two keys.<ref>{{Cite journal|last=Kartit|first=Zaid|date=February 2016|title=Applying Encryption Algorithms for Data Security in Cloud Storage, Kartit, et al. |url=https://books.google.com/books?id=uEGFCwAAQBAJ&q=%22keys+may+be+identical%22&pg=PA147|journal=Advances in Ubiquitous Networking: Proceedings of UNet15|pages=147|isbn=9789812879905}}</ref> The keys, in practice, represent a [[shared secret]] between two or more parties that can be used to maintain a private information link.<ref>{{cite book |author=Delfs, Hans |author2=Knebl, Helmut |chapter = Symmetric-key encryption |title = Introduction to cryptography: principles and applications |publisher = Springer |year = 2007 |isbn = 9783540492436 |chapter-url = https://books.google.com/books?id=Nnvhz_VqAS4C&pg=PA11 }}</ref> The requirement that both parties have access to the secret key is one of the main drawbacks of [[symmetric]]-key encryption, in comparison to [[Public key encryption|public-key encryption]] (also known as asymmetric-key encryption).<ref>{{cite book |author=Mullen, Gary |author2=Mummert, Carl |title = Finite fields and applications |publisher = American Mathematical Society |year = 2007 |isbn = 9780821844182 |page = 112 |url = https://books.google.com/books?id=yDgWctqWL4wC&pg=PA112 }}</ref><ref>{{cite web |url = https://www.geeksforgeeks.org/difference-between-symmetric-and-asymmetric-key-encryption/ |title = Demystifying symmetric and asymmetric methods of encryption |publisher = Geeks for Geeks |date = 2017-09-28 }}</ref> However, symmetric-key encryption algorithms are usually better for bulk encryption. With exception of the [[one-time pad]] they have a smaller key size, which means less storage space and faster transmission. Due to this, asymmetric-key encryption is often used to exchange the secret key for symmetric-key encryption.<ref>{{Citation|last=Johnson|first=Leighton|title=Security Component Fundamentals for Assessment|date=2016|url=http://dx.doi.org/10.1016/b978-0-12-802324-2.00011-7|work=Security Controls Evaluation, Testing, and Assessment Handbook|pages=531–627|publisher=Elsevier|doi=10.1016/b978-0-12-802324-2.00011-7|isbn=9780128023242|s2cid=63087943 |access-date=2021-12-06}}</ref><ref>{{Cite journal |last1=Alvarez |first1=Rafael |last2=Caballero-Gil |first2=Cándido |last3=Santonja |first3=Juan |last4=Zamora |first4=Antonio |date=2017-06-27 |title=Algorithms for Lightweight Key Exchange |journal=Sensors |language=en |volume=17 |issue=7 |pages=1517 |doi=10.3390/s17071517 |issn=1424-8220 |pmc=5551094 |pmid=28654006|doi-access=free }}</ref><ref>{{Cite journal |last1=Bernstein |first1=Daniel J. |last2=Lange |first2=Tanja |date=2017-09-14 |title=Post-quantum cryptography |url=http://www.nature.com/articles/nature23461 |journal=Nature |language=en |volume=549 |issue=7671 |pages=188–194 |doi=10.1038/nature23461 |pmid=28905891 |bibcode=2017Natur.549..188B |s2cid=4446249 |issn=0028-0836}}</ref> == Types == Symmetric-key encryption can use either [[stream cipher]]s or [[block cipher]]s.<ref>{{cite book |last = Pelzl & Paar |title = Understanding Cryptography |url = https://archive.org/details/understandingcry00paar |url-access = limited |year = 2010 |publisher = Springer-Verlag |location = Berlin |page = [https://archive.org/details/understandingcry00paar/page/n44 30] |bibcode = 2010uncr.book.....P }}</ref> Stream ciphers encrypt the digits (typically [[byte]]s), or letters (in substitution ciphers) of a message one at a time. An example is [[ChaCha20]]. [[Substitution cipher]]s are well-known ciphers, but can be easily decrypted using a [[frequency table]].<ref>{{Cite book|last1=Bellare|first1=Mihir|url=https://web.cs.ucdavis.edu/~rogaway/classes/227/spring05/book/main.pdf|title=Introduction to Modern Cryptography|last2=Rogaway|first2=Phillip|year=2005|language=English}}</ref> Block ciphers take a number of bits and encrypt them in a single unit, padding the plaintext to achieve a multiple of the block size. The [[Advanced Encryption Standard]] (AES) algorithm, approved by [[NIST]] in December 2001, uses 128-bit blocks. == Implementations == Examples of popular symmetric-key algorithms include [[Twofish]], [[Serpent (cipher)|Serpent]], [[Advanced Encryption Standard|AES]] (Rijndael), [[Camellia (cipher)|Camellia]], [[Salsa20]], [[ChaCha20]], [[Blowfish (cipher)|Blowfish]], [[CAST5]], [[Kuznyechik]], [[RC4]], [[Data Encryption Standard|DES]], [[Triple DES|3DES]], [[Skipjack (cipher)|Skipjack]], [[Secure and Fast Encryption Routine|Safer]], and [[International Data Encryption Algorithm|IDEA]].<ref>{{Cite web|url=http://www.cs.cornell.edu/courses/cs5430/2010sp/TL03.symmetric.html|title=Symmetric-Key Cryptography|last=Roeder|first=Tom|website=www.cs.cornell.edu|language=en|access-date=2017-02-05}}</ref> == Use as a cryptographic primitive == Symmetric ciphers are commonly used to achieve other [[cryptographic primitive]]s than just encryption.{{citation needed|date=April 2012}} Encrypting a message does not guarantee that it will remain unchanged while encrypted. Hence, often a [[message authentication code]] is added to a ciphertext to ensure that changes to the ciphertext will be noted by the receiver. Message authentication codes can be constructed from an [[AEAD]] cipher (e.g. [[AES-GCM]]). However, symmetric ciphers cannot be used for [[non-repudiation]] purposes except by involving additional parties.<ref>{{Cite web|url=http://www.iso.org/cms/render/live/en/sites/isoorg/contents/data/standard/04/47/44736.html|title=ISO/IEC 13888-2:2010 |website=ISO|language=en|access-date=2020-02-04}}</ref> See the [http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=44736 ISO/IEC 13888-2 standard]. Another application is to build [[hash function]]s from block ciphers. See [[one-way compression function]] for descriptions of several such methods. == Construction of symmetric ciphers == {{Main|Feistel cipher}} Many modern block ciphers are based on a construction proposed by [[Horst Feistel]]. Feistel's construction makes it possible to build invertible functions from other functions that are themselves not invertible.{{citation needed|date=April 2012}} == Security of symmetric ciphers == Symmetric ciphers have historically been susceptible to [[known-plaintext attack]]s, [[chosen-plaintext attack]]s, [[differential cryptanalysis]] and [[linear cryptanalysis]]. Careful construction of the functions for each [[Round (cryptography)|round]] can greatly reduce the chances of a successful attack.{{citation needed|date=April 2012}} It is also possible to increase the key length or the rounds in the encryption process to better protect against attack. This, however, tends to increase the processing power and decrease the speed at which the process runs due to the amount of operations the system needs to do.<ref>{{Cite book |title=Hack proofing your network|date=2002|publisher=Syngress|author=David R. Mirza Ahmad |author2=Ryan Russell|isbn=1-932266-18-6|edition=2nd |location=Rockland, MA|pages=165–203|oclc=51564102}}</ref> Most modern symmetric-key algorithms appear to be resistant to the threat of [[post-quantum cryptography]].<ref name="djb-intro">{{cite book |author=Daniel J. Bernstein |title=Post-Quantum Cryptography |year=2009 |chapter=Introduction to post-quantum cryptography |author-link=Daniel J. Bernstein |chapter-url=http://www.pqcrypto.org/www.springer.com/cda/content/document/cda_downloaddocument/9783540887010-c1.pdf}}</ref> [[Quantum computing|Quantum computers]] would exponentially increase the speed at which these ciphers can be decoded; notably, [[Grover's algorithm]] would take the square-root of the time traditionally required for a [[brute-force attack]], although these vulnerabilities can be compensated for by doubling key length.<ref name="djb-groverr">{{cite journal |author=Daniel J. Bernstein |author-link=Daniel J. Bernstein |date=2010-03-03 |title=Grover vs. McEliece |url=http://cr.yp.to/codes/grovercode-20100303.pdf}}</ref> For example, a 128 bit AES cipher would not be secure against such an attack as it would reduce the time required to test all possible iterations from over 10 quintillion years to about six months. By contrast, it would still take a quantum computer the same amount of time to decode a 256 bit AES cipher as it would a conventional computer to decode a 128 bit AES cipher.<ref>{{Cite web |last=Wood |first=Lamont |date=2011-03-21 |title=The Clock Is Ticking for Encryption |url=https://www.computerworld.com/article/2550008/the-clock-is-ticking-for-encryption.html |access-date=2022-12-05 |website=Computerworld |language=en}}</ref> For this reason, AES-256 is believed to be "quantum resistant".<ref>{{Cite web |last=O'Shea |first=Dan |date=2022-04-29 |title=AES-256 joins the quantum resistance |url=https://www.fierceelectronics.com/electronics/aes-256-joins-quantum-resistance |access-date=2022-12-05 |website=Fierce Electronics |language=en}}</ref><ref>{{Citation |last1=Weissbaum |first1=François |title=Symmetric Cryptography |date=2023 |work=Trends in Data Protection and Encryption Technologies |pages=7–10 |editor-last=Mulder |editor-first=Valentin |place=Cham |publisher=Springer Nature Switzerland |language=en |doi=10.1007/978-3-031-33386-6_2 |isbn=978-3-031-33386-6 |last2=Lugrin |first2=Thomas |editor2-last=Mermoud |editor2-first=Alain |editor3-last=Lenders |editor3-first=Vincent |editor4-last=Tellenbach |editor4-first=Bernhard|doi-access=free }}</ref> == Key management == {{main|Key Management Interoperability Protocol}} == Key establishment == {{ main | Key establishment }} Symmetric-key algorithms require both the sender and the recipient of a message to have the same secret key. All early cryptographic systems required either the sender or the recipient to somehow receive a copy of that secret key over a physically secure channel. Nearly all modern cryptographic systems still use symmetric-key algorithms internally to encrypt the bulk of the messages, but they eliminate the need for a physically secure channel by using [[Diffie–Hellman key exchange]] or some other [[public-key cryptography|public-key protocol]] to securely come to agreement on a fresh new secret key for each session/conversation (forward secrecy). == Key generation == {{ main | key generation }} When used with asymmetric ciphers for key transfer, [[Cryptographically secure pseudorandom number generator|pseudorandom key generator]]s are nearly always used to generate the symmetric cipher session keys. However, lack of randomness in those generators or in their [[initialization vector]]s is disastrous and has led to cryptanalytic breaks in the past. Therefore, it is essential that an implementation use a source of high [[Entropy (information theory)|entropy]] for its initialization.<ref> Ian Goldberg and David Wagner. [http://www.cs.berkeley.edu/~daw/papers/ddj-netscape.html "Randomness and the Netscape Browser"]. January 1996 Dr. Dobb's Journal. quote: "it is vital that the secret keys be generated from an unpredictable random-number source." </ref><ref> {{cite web |first1=Thomas |last1=Ristenpart |first2=Scott |last2=Yilek |title=When Good Randomness Goes Bad: Virtual Machine Reset Vulnerabilities and Hedging Deployed Cryptography |date=2010 |work=NDSS Symposium 2010 |url=https://www.ndss-symposium.org/wp-content/uploads/2017/09/rist.pdf |quote=Random number generators (RNGs) are consistently a weak link in the secure use of cryptography.}} </ref><ref>{{cite web |url = http://www.webhosting.uk.com/blog/symmetric-cryptography/ |title = Symmetric Cryptography |publisher = James |date = 2006-03-11 }}</ref> == Reciprocal cipher == {{More citations needed section|date=December 2015}} A reciprocal cipher is a cipher where, just as one enters the [[plaintext]] into the [[cryptography]] system to get the [[ciphertext]], one could enter the ciphertext into the same place in the system to get the plaintext. A reciprocal cipher is also sometimes referred as '''self-reciprocal cipher'''.<ref> Paul Reuvers and Marc Simons. Crypto Museum. [https://www.cryptomuseum.com/crypto/enigma/uhr/ "Enigma Uhr"]. 2009. </ref><ref> Chris Christensen. [https://www.nku.edu/~christensen/section%201%20substitution%20ciphers.pdf "Simple Substitution Ciphers"]. 2006. </ref> Practically all mechanical cipher machines implement a reciprocal cipher, a [[involution (mathematics)|mathematical involution]] on each typed-in letter. Instead of designing two kinds of machines, one for encrypting and one for decrypting, all the machines can be identical and can be set up (keyed) the same way.<ref> Greg Goebel. [http://vc.airvectors.net/ttcode_05.html "The Mechanization of Ciphers"]. 2018. </ref> Examples of reciprocal ciphers include: * [[Atbash]] * [[Beaufort cipher]]<ref> "... the true Beaufort cipher. Notice that we have ''reciprocal encipherment''; encipherment and decipherment are identically the same thing." -- Helen F. Gaines. [https://books.google.com/books?id=Zb2RBQAAQBAJ "Cryptanalysis: A Study of Ciphers and Their Solution"]. 2014. p. 121. </ref> * [[Enigma machine]]<ref> Greg Goebel. [http://vc.airvectors.net/ttcode_05.html "The Mechanization of Ciphers"]. 2018. </ref> * Marie Antoinette and [[Axel von Fersen the Younger|Axel von Fersen]] communicated with a self-reciprocal cipher.<ref> Friedrich L. Bauer. [https://books.google.com/books?id=hfWTDr_bvMwC "Decrypted Secrets: Methods and Maxims of Cryptology"]. 2006. p. 144 </ref> * the Porta polyalphabetic cipher is self-reciprocal.<ref> David Salomon. [https://books.google.com/books?id=Zr9bjEpXKnIC "Coding for Data and Computer Communications"]. 2006. p. 245 </ref> * [[Purple cipher]]<ref> Greg Goebel. [http://vc.airvectors.net/ttcode_06.html "US Codebreakers In The Shadow Of War"]. 2018. </ref> * [[RC4]] * [[ROT13]] * [[XOR cipher]] * [[Vatsyayana cipher]] The majority of all modern ciphers can be classified as either a [[stream cipher]], most of which use a reciprocal [[XOR cipher]] combiner, or a [[block cipher]], most of which use a [[Feistel cipher]] or [[Lai–Massey scheme]] with a reciprocal transformation in each round.{{cn|date=May 2024}} ==Notes== {{Noteslist}} ==References== {{Reflist}} {{Cryptography navbox | block | stream}} {{Authority control}} {{DEFAULTSORT:Symmetric-Key Algorithm}} [[Category:Cryptographic algorithms]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Cn
(
edit
)
Template:Cryptography navbox
(
edit
)
Template:Efn
(
edit
)
Template:Main
(
edit
)
Template:More citations needed section
(
edit
)
Template:Noteslist
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)