des-0.8.1/.cargo_vcs_info.json0000644000000001410000000000100116110ustar { "git": { "sha1": "7de364ede310f1ea7080c99ddf1138aeb47f9a69" }, "path_in_vcs": "des" }des-0.8.1/CHANGELOG.md000064400000000000000000000026300072674642500122470ustar 00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## 0.8.1 (2022-02-17) ### Fixed - Minimal versions build ([#303]) [#303]: https://github.com/RustCrypto/block-ciphers/pull/303 ## 0.8.0 (2022-02-10) ### Changed - Bump `cipher` dependency to v0.4 ([#284]) [#284]: https://github.com/RustCrypto/block-ciphers/pull/284 ## 0.7.0 (2021-04-29) ### Changed - Bump `cipher` dependency to v0.3 ([#235]) [#235]: https://github.com/RustCrypto/block-ciphers/pull/235 ## 0.6.0 (2020-10-16) ### Changed - Replace `block-cipher`/`stream-cipher` with `cipher` crate ([#167]) [#167]: https://github.com/RustCrypto/block-ciphers/pull/167 ## 0.5.0 (2020-08-07) ### Changed - Bump `block-cipher` dependency to v0.8 ([#138]) - Bump `opaque-debug` dependency to v0.3 ([#140]) [#138]: https://github.com/RustCrypto/block-ciphers/pull/138 [#140]: https://github.com/RustCrypto/block-ciphers/pull/140 ## 0.4.0 (2020-06-08) ### Changed - Bump `block-cipher` dependency to v0.7 ([#90]) - Upgrade to Rust 2018 edition ([#90]) [#90]: https://github.com/RustCrypto/block-ciphers/pull/90 ## 0.3.0 (2018-12-23) ## 0.2.0 (2018-11-14) ## 0.1.0 (2017-11-26) ## 0.0.4 (2017-01-18) ## 0.0.3 (2016-08-27) ## 0.0.2 (2016-08-10) ## 0.0.1 (2016-04-24) des-0.8.1/Cargo.toml0000644000000021470000000000100076170ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.56" name = "des" version = "0.8.1" authors = ["RustCrypto Developers"] description = "DES and Triple DES (3DES, TDES) block ciphers implementation" documentation = "https://docs.rs/des" readme = "README.md" keywords = ["crypto", "des", "tdes", "block-cipher"] categories = ["cryptography", "no-std"] license = "MIT OR Apache-2.0" repository = "https://github.com/RustCrypto/block-ciphers" [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies.cipher] version = "0.4.2" [dev-dependencies.cipher] version = "0.4.2" features = ["dev"] [features] zeroize = ["cipher/zeroize"] des-0.8.1/Cargo.toml.orig000064400000000000000000000013160072674642500133250ustar 00000000000000[package] name = "des" version = "0.8.1" # Also update html_root_url in lib.rs when bumping this description = "DES and Triple DES (3DES, TDES) block ciphers implementation" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" edition = "2021" rust-version = "1.56" readme = "README.md" documentation = "https://docs.rs/des" repository = "https://github.com/RustCrypto/block-ciphers" keywords = ["crypto", "des", "tdes", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] cipher = "0.4.2" [dev-dependencies] cipher = { version = "0.4.2", features = ["dev"] } [features] zeroize = ["cipher/zeroize"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] des-0.8.1/LICENSE-APACHE000064400000000000000000000251230072674642500123640ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2017 Gulshan Singh Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. des-0.8.1/LICENSE-MIT000064400000000000000000000021000072674642500120620ustar 00000000000000Copyright (c) 2017 Gulshan Singh, Antoni Boucher, Artyom Pavlov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. des-0.8.1/README.md000064400000000000000000000050620072674642500117170ustar 00000000000000# RustCrypto: Data Encryption Standard (DES) and 3DES [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] [![Build Status][build-image]][build-link] [![HAZMAT][hazmat-image]][hazmat-link] Pure Rust implementation of the [DES cipher][1], including triple DES (3DES). [Documentation][docs-link] ## ⚠️ Security Warning: [Hazmat!][hazmat-link] This crate does not ensure ciphertexts are authentic (i.e. by using a MAC to verify ciphertext integrity), which can lead to serious vulnerabilities if used incorrectly! No security audits of this crate have ever been performed, and it has not been thoroughly assessed to ensure its operation is constant-time on common CPU architectures. USE AT YOUR OWN RISK! ## Minimum Supported Rust Version Rust **1.56** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. ## SemVer Policy - All on-by-default features of this library are covered by SemVer - MSRV is considered exempt from SemVer as noted above ## License Licensed under either of: * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) * [MIT license](http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://img.shields.io/crates/v/des.svg [crate-link]: https://crates.io/crates/des [docs-image]: https://docs.rs/des/badge.svg [docs-link]: https://docs.rs/des/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg [hazmat-image]: https://img.shields.io/badge/crypto-hazmat%E2%9A%A0-red.svg [hazmat-link]: https://github.com/RustCrypto/meta/blob/master/HAZMAT.md [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260039-block-ciphers [build-image]: https://github.com/RustCrypto/block-ciphers/workflows/des/badge.svg?branch=master&event=push [build-link]: https://github.com/RustCrypto/block-ciphers/actions?query=workflow%3Ades [//]: # (general links) [1]: https://en.wikipedia.org/wiki/Data_Encryption_Standard des-0.8.1/benches/mod.rs000064400000000000000000000007420072674642500131740ustar 00000000000000#![feature(test)] extern crate test; use cipher::{block_decryptor_bench, block_encryptor_bench}; use des::{Des, TdesEde3}; block_encryptor_bench!(Key: Des, des_encrypt_block, des_encrypt_blocks); block_decryptor_bench!(Key: Des, des_decrypt_block, des_decrypt_blocks); block_encryptor_bench!( Key: TdesEde3, tdes_ede3_encrypt_block, tdes_ede3_encrypt_blocks, ); block_decryptor_bench!( Key: TdesEde3, tdes_ede3_decrypt_block, tdes_ede3_decrypt_blocks, ); des-0.8.1/src/consts.rs000064400000000000000000000056470072674642500131170ustar 00000000000000pub const SHIFTS: [u8; 16] = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; // These boxes are not the same ones that appear in the literature. Normally, // the first and the last bits of the six input bits are used to choose the row // and the middle four bits are used to choose the column. These sboxes are // rearranged so that the bottom four bits choose the column and the top two // bits choose the row. In other words, we can directly index the sbox array // with the 6 input bits to get the correct value. #[rustfmt::skip] pub const SBOXES: [[u8; 64]; 8] = [ [ 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, ], [ 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, ], [ 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, ], [ 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, ], [ 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, ], [ 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, ], [ 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, ], [ 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11, ], ]; des-0.8.1/src/des.rs000064400000000000000000000164450072674642500123570ustar 00000000000000//! Data Encryption Standard (DES) block cipher. #![allow(clippy::unreadable_literal)] use cipher::{consts::U8, AlgorithmName, BlockCipher, Key, KeyInit, KeySizeUser}; use core::fmt; #[cfg(feature = "zeroize")] use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; use crate::consts::{SBOXES, SHIFTS}; /// Data Encryption Standard (DES) block cipher. #[derive(Clone)] pub struct Des { pub(crate) keys: [u64; 16], } /// Swap bits in `a` using a delta swap fn delta_swap(a: u64, delta: u64, mask: u64) -> u64 { let b = (a ^ (a >> delta)) & mask; a ^ b ^ (b << delta) } /// Swap bits using the PC-1 table fn pc1(mut key: u64) -> u64 { key = delta_swap(key, 2, 0x3333000033330000); key = delta_swap(key, 4, 0x0f0f0f0f00000000); key = delta_swap(key, 8, 0x009a000a00a200a8); key = delta_swap(key, 16, 0x00006c6c0000cccc); key = delta_swap(key, 1, 0x1045500500550550); key = delta_swap(key, 32, 0x00000000f0f0f5fa); key = delta_swap(key, 8, 0x00550055006a00aa); key = delta_swap(key, 2, 0x0000333330000300); key & 0xFFFFFFFFFFFFFF00 } /// Swap bits using the PC-2 table fn pc2(key: u64) -> u64 { let key = key.rotate_left(61); let b1 = (key & 0x0021000002000000) >> 7; let b2 = (key & 0x0008020010080000) << 1; let b3 = key & 0x0002200000000000; let b4 = (key & 0x0000000000100020) << 19; let b5 = (key.rotate_left(54) & 0x0005312400000011).wrapping_mul(0x0000000094200201) & 0xea40100880000000; let b6 = (key.rotate_left(7) & 0x0022110000012001).wrapping_mul(0x0001000000610006) & 0x1185004400000000; let b7 = (key.rotate_left(6) & 0x0000520040200002).wrapping_mul(0x00000080000000c1) & 0x0028811000200000; let b8 = (key & 0x01000004c0011100).wrapping_mul(0x0000000000004284) & 0x0400082244400000; let b9 = (key.rotate_left(60) & 0x0000000000820280).wrapping_mul(0x0000000000089001) & 0x0000000110880000; let b10 = (key.rotate_left(49) & 0x0000000000024084).wrapping_mul(0x0000000002040005) & 0x000000000a030000; b1 | b2 | b3 | b4 | b5 | b6 | b7 | b8 | b9 | b10 } /// Swap bits using the reverse FP table fn fp(mut message: u64) -> u64 { message = delta_swap(message, 24, 0x000000FF000000FF); message = delta_swap(message, 24, 0x00000000FF00FF00); message = delta_swap(message, 36, 0x000000000F0F0F0F); message = delta_swap(message, 18, 0x0000333300003333); delta_swap(message, 9, 0x0055005500550055) } /// Swap bits using the IP table fn ip(mut message: u64) -> u64 { message = delta_swap(message, 9, 0x0055005500550055); message = delta_swap(message, 18, 0x0000333300003333); message = delta_swap(message, 36, 0x000000000F0F0F0F); message = delta_swap(message, 24, 0x00000000FF00FF00); delta_swap(message, 24, 0x000000FF000000FF) } /// Swap bits using the E table fn e(block: u64) -> u64 { const BLOCK_LEN: usize = 32; const RESULT_LEN: usize = 48; let b1 = (block << (BLOCK_LEN - 1)) & 0x8000000000000000; let b2 = (block >> 1) & 0x7C00000000000000; let b3 = (block >> 3) & 0x03F0000000000000; let b4 = (block >> 5) & 0x000FC00000000000; let b5 = (block >> 7) & 0x00003F0000000000; let b6 = (block >> 9) & 0x000000FC00000000; let b7 = (block >> 11) & 0x00000003F0000000; let b8 = (block >> 13) & 0x000000000FC00000; let b9 = (block >> 15) & 0x00000000003E0000; let b10 = (block >> (RESULT_LEN - 1)) & 0x0000000000010000; b1 | b2 | b3 | b4 | b5 | b6 | b7 | b8 | b9 | b10 } /// Swap bits using the P table fn p(block: u64) -> u64 { let block = block.rotate_left(44); let b1 = (block & 0x0000000000200000) << 32; let b2 = (block & 0x0000000000480000) << 13; let b3 = (block & 0x0000088000000000) << 12; let b4 = (block & 0x0000002020120000) << 25; let b5 = (block & 0x0000000442000000) << 14; let b6 = (block & 0x0000000001800000) << 37; let b7 = (block & 0x0000000004000000) << 24; let b8 = (block & 0x0000020280015000).wrapping_mul(0x0000020080800083) & 0x02000a6400000000; let b9 = (block.rotate_left(29) & 0x01001400000000aa).wrapping_mul(0x0000210210008081) & 0x0902c01200000000; let b10 = (block & 0x0000000910040000).wrapping_mul(0x0000000c04000020) & 0x8410010000000000; b1 | b2 | b3 | b4 | b5 | b6 | b7 | b8 | b9 | b10 } /// Generate the 16 subkeys pub(crate) fn gen_keys(key: u64) -> [u64; 16] { let mut keys: [u64; 16] = [0; 16]; let key = pc1(key); // The most significant bit is bit zero, and there are only 56 bits in // the key after applying PC1, so we need to remove the eight least // significant bits from the key. let key = key >> 8; let mut c = key >> 28; let mut d = key & 0x0FFFFFFF; for i in 0..16 { c = rotate(c, SHIFTS[i]); d = rotate(d, SHIFTS[i]); // We need the `<< 8` because the most significant bit is bit zero, // so we need to shift our 56 bit value 8 bits to the left. keys[i] = pc2(((c << 28) | d) << 8); } keys } /// Performs a left rotate on a 28 bit number fn rotate(mut val: u64, shift: u8) -> u64 { let top_bits = val >> (28 - shift); val <<= shift; (val | top_bits) & 0x0FFFFFFF } fn round(input: u64, key: u64) -> u64 { let l = input & (0xFFFF_FFFF << 32); let r = input << 32; r | ((f(r, key) ^ l) >> 32) } fn f(input: u64, key: u64) -> u64 { let mut val = e(input as u64); val ^= key; val = apply_sboxes(val); p(val) } /// Applies all eight sboxes to the input fn apply_sboxes(input: u64) -> u64 { let mut output: u64 = 0; for (i, sbox) in SBOXES.iter().enumerate() { let val = (input >> (58 - (i * 6))) & 0x3F; output |= u64::from(sbox[val as usize]) << (60 - (i * 4)); } output } impl Des { pub(crate) fn encrypt(&self, mut data: u64) -> u64 { data = ip(data); for key in &self.keys { data = round(data, *key); } fp((data << 32) | (data >> 32)) } pub(crate) fn decrypt(&self, mut data: u64) -> u64 { data = ip(data); for key in self.keys.iter().rev() { data = round(data, *key); } fp((data << 32) | (data >> 32)) } } impl BlockCipher for Des {} impl KeySizeUser for Des { type KeySize = U8; } impl KeyInit for Des { #[inline] fn new(key: &Key) -> Self { let keys = gen_keys(u64::from_be_bytes(key.clone().into())); Self { keys } } } impl fmt::Debug for Des { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("Des { ... }") } } impl AlgorithmName for Des { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("Des") } } #[cfg(feature = "zeroize")] #[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))] impl Drop for Des { fn drop(&mut self) { self.keys.zeroize(); } } #[cfg(feature = "zeroize")] #[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))] impl ZeroizeOnDrop for Des {} cipher::impl_simple_block_encdec!( Des, U8, cipher, block, encrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.encrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } decrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.decrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } ); des-0.8.1/src/lib.rs000064400000000000000000000021350072674642500123410ustar 00000000000000//! Pure Rust implementation of the [Data Encryption Standard][DES] (DES), //! including [Triple DES] (TDES, 3DES) block ciphers. //! //! # ⚠️ Security Warning: Hazmat! //! //! This crate implements only the low-level block cipher function, and is intended //! for use for implementing higher-level constructions *only*. It is NOT //! intended for direct use in applications. //! //! USE AT YOUR OWN RISK! //! //! [DES]: https://en.wikipedia.org/wiki/Data_Encryption_Standard //! [Triple DES]: https://en.wikipedia.org/wiki/Triple_DES #![no_std] #![doc( html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/26acc39f/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/26acc39f/logo.svg", html_root_url = "https://docs.rs/des/0.8.1" )] #![deny(unsafe_code)] #![cfg_attr(docsrs, feature(doc_cfg))] #![warn(missing_docs, rust_2018_idioms)] #![allow(clippy::clone_on_copy)] // TODO: remove on migration to const generics pub use cipher; mod consts; mod des; mod tdes; pub use crate::des::Des; pub use crate::tdes::{TdesEde2, TdesEde3, TdesEee2, TdesEee3}; des-0.8.1/src/tdes.rs000064400000000000000000000151030072674642500125310ustar 00000000000000//! Triple DES (3DES) block ciphers. use crate::des::{gen_keys, Des}; use cipher::{ consts::{U16, U24, U8}, AlgorithmName, BlockCipher, Key, KeyInit, KeySizeUser, }; use core::fmt; #[cfg(feature = "zeroize")] use cipher::zeroize::ZeroizeOnDrop; /// Triple DES (3DES) block cipher. #[derive(Clone)] pub struct TdesEde3 { d1: Des, d2: Des, d3: Des, } impl BlockCipher for TdesEde3 {} impl KeySizeUser for TdesEde3 { type KeySize = U24; } impl KeyInit for TdesEde3 { #[inline] fn new(key: &Key) -> Self { let k1 = u64::from_be_bytes(key[0..8].try_into().unwrap()); let k2 = u64::from_be_bytes(key[8..16].try_into().unwrap()); let k3 = u64::from_be_bytes(key[16..24].try_into().unwrap()); let d1 = Des { keys: gen_keys(k1) }; let d2 = Des { keys: gen_keys(k2) }; let d3 = Des { keys: gen_keys(k3) }; Self { d1, d2, d3 } } } impl fmt::Debug for TdesEde3 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEee3 { ... }") } } impl AlgorithmName for TdesEde3 { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEde3") } } #[cfg(feature = "zeroize")] #[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))] impl ZeroizeOnDrop for TdesEde3 {} cipher::impl_simple_block_encdec!( TdesEde3, U8, cipher, block, encrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d1.encrypt(data); data = cipher.d2.decrypt(data); data = cipher.d3.encrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } decrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d3.decrypt(data); data = cipher.d2.encrypt(data); data = cipher.d1.decrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } ); /// Triple DES (3DES) block cipher. #[derive(Clone)] pub struct TdesEee3 { d1: Des, d2: Des, d3: Des, } impl BlockCipher for TdesEee3 {} impl KeySizeUser for TdesEee3 { type KeySize = U24; } impl KeyInit for TdesEee3 { #[inline] fn new(key: &Key) -> Self { let k1 = u64::from_be_bytes(key[0..8].try_into().unwrap()); let k2 = u64::from_be_bytes(key[8..16].try_into().unwrap()); let k3 = u64::from_be_bytes(key[16..24].try_into().unwrap()); let d1 = Des { keys: gen_keys(k1) }; let d2 = Des { keys: gen_keys(k2) }; let d3 = Des { keys: gen_keys(k3) }; Self { d1, d2, d3 } } } impl fmt::Debug for TdesEee3 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEee3 { ... }") } } impl AlgorithmName for TdesEee3 { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEee3") } } #[cfg(feature = "zeroize")] #[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))] impl ZeroizeOnDrop for TdesEee3 {} cipher::impl_simple_block_encdec!( TdesEee3, U8, cipher, block, encrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d1.encrypt(data); data = cipher.d2.encrypt(data); data = cipher.d3.encrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } decrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d3.decrypt(data); data = cipher.d2.decrypt(data); data = cipher.d1.decrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } ); /// Triple DES (3DES) block cipher. #[derive(Clone)] pub struct TdesEde2 { d1: Des, d2: Des, } impl BlockCipher for TdesEde2 {} impl KeySizeUser for TdesEde2 { type KeySize = U16; } impl KeyInit for TdesEde2 { #[inline] fn new(key: &Key) -> Self { let k1 = u64::from_be_bytes(key[0..8].try_into().unwrap()); let k2 = u64::from_be_bytes(key[8..16].try_into().unwrap()); let d1 = Des { keys: gen_keys(k1) }; let d2 = Des { keys: gen_keys(k2) }; Self { d1, d2 } } } impl fmt::Debug for TdesEde2 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEde2 { ... }") } } impl AlgorithmName for TdesEde2 { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEde2") } } #[cfg(feature = "zeroize")] #[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))] impl ZeroizeOnDrop for TdesEde2 {} cipher::impl_simple_block_encdec!( TdesEde2, U8, cipher, block, encrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d1.encrypt(data); data = cipher.d2.decrypt(data); data = cipher.d1.encrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } decrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d1.decrypt(data); data = cipher.d2.encrypt(data); data = cipher.d1.decrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } ); /// Triple DES (3DES) block cipher. #[derive(Clone)] pub struct TdesEee2 { d1: Des, d2: Des, } impl BlockCipher for TdesEee2 {} impl KeySizeUser for TdesEee2 { type KeySize = U16; } impl KeyInit for TdesEee2 { #[inline] fn new(key: &Key) -> Self { let k1 = u64::from_be_bytes(key[0..8].try_into().unwrap()); let k2 = u64::from_be_bytes(key[8..16].try_into().unwrap()); let d1 = Des { keys: gen_keys(k1) }; let d2 = Des { keys: gen_keys(k2) }; Self { d1, d2 } } } impl fmt::Debug for TdesEee2 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEee2 { ... }") } } impl AlgorithmName for TdesEee2 { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("TdesEee2") } } #[cfg(feature = "zeroize")] #[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))] impl ZeroizeOnDrop for TdesEee2 {} cipher::impl_simple_block_encdec!( TdesEee2, U8, cipher, block, encrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d1.encrypt(data); data = cipher.d2.encrypt(data); data = cipher.d1.encrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } decrypt: { let mut data = u64::from_be_bytes(block.clone_in().into()); data = cipher.d1.decrypt(data); data = cipher.d2.decrypt(data); data = cipher.d1.decrypt(data); block.get_out().copy_from_slice(&data.to_be_bytes()); } ); des-0.8.1/tests/data/des.blb000064400000000000000000000273100072674642500137470ustar 00000000000000M#////////TTTTTTTT3333333366666666    >>>>>>>> uuuuuuuu````````$$$$$$$$qqqqqqqq%%%%%%%% @@vvvvvvvv((((((((;;;;;;;;DDDDDDDDMMMMMMMM11111111XXXXXXXX!!!!!!!!{{{{{{{{dddddddd}}}}}}}}BBBBBBBBiiiiiiiioooooooo@||||||||00000000SSSSSSSSUUUUUUUUEEEEEEEEAAAAAAAA@nnnnnnnn,,,,,,,,gggggggg--------[[[[[[[[ WWWWWWWW cccccccc~~~~~~~~========99999999RRRRRRRRLLLLLLLL  @________HHHHHHHHbbbbbbbb\\\\\\\\ssssssssyyyyyyyyzzzzzzzz@########<<<<<<<< KKKKKKKK@OOOOOOOO""""""""xxxxxxxxhhhhhhhhttttttttGGGGGGGG FFFFFFFF&&&&&&&&eeeeeeee88888888))))))))kkkkkkkk mmmmmmmm77777777ffffff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%%%%%::::::::::::::::::::::::TSo/>d@%aE========================&&&&&&&&&&&&&&&&&&&&&&&&2J,,,,,,,,,,,,,,,,,,,,,,,,WWWWWWWWWWWWWWWWWWWWWWWW@VVVVVVVVwwwwwwwwwwwwwwwwwwwwwwwwmmmmmmmmmmmmmmmmmmmmmmmm@іgŝMMWlRaaaaaaaaGGGGGGGG333333333333333333333333 h))f44444444------------------------HHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAA1';oQšRY;Wsy}222222222222222222222222  -6^ Q{rrrrrrrrrrrrrrrrrrrrrrrrKӈlO r........]ey⭃&_Dz-;ntyyyyyyyyyyyyyyyyyyyyyyyy?Y^ U3PXeN71'MP62J38h]''''''''@ bbbbbbbbbbbbbbbbbbbbbbbb[[[[[[[[;< ?T @9.)Vm'E++++++++++++++++++++++++ lwceZ-ߐyl']jF3/@xxxxxxxxxxxxxxxxxxxxxxxx33333333[[[[[[[[[[[[[[[[[[[[[[[[)^](ke(+/ ((((((((((((((((((((((((yyyyyyyy2#+&;2+`kkkkkkkkkkkkkkkkkkkkkkkkL>4p55555555qqqqqqqqssssssssFm99999999jLVQQQQQQQQ]]]]]]]]]]]]]]]]]]]]]]]]KKKKKKKKKKKKKKKKKKKKKKKKߘ'oTK9Y@\\\\\\\\MMMMMMMMMMMMMMMMMMMMMMMM@@@@@@@@@@@@@@@@@@@@@@@@]________aaaaaaaaaaaaaaaaaaaaaaaaJJJJJJJJJJJJJJJJJJJJJJJJDR/LLLLLLLLLLLLLLLLLLLLLLLLVg -ho CCCCCCCC000000000000000000000000y ,z/ +!bccccccccaLoM!KKKKKKKKl fOOOOOOOO7qLqZ PPPPPPPPPPPPPPPPPPPPPPPP@PPPPPPPPBBP|=QSSSSSSSSSSSSSSSSSSSSSSSS{I7^8q\yYYYYYYYYYYYYYYYYYYYYYYYY %W<@R}J""""""""""""""""""""""""|0n [uܞ<ޒ////////////////////////uuuuuuuuuuuuuuuuuuuuuuuu%%%%%%%%lQ/TTTTTTTT}}}}}}}}A `hlio************************h "%@ udpG+&)݌&n"G'"LAsY>NX<܇ @]#cm-ɥ!9ffffffff/(:}Ҳ 3#)$2(oqBBBBBBBBcccccccccccccccccccccccc:+mí8ܜzzzzzzzzdddddddddddddddddddddddd########################ɶ@B@ :*  'qW(KtXXXXXXXXXXXXXXXXXXXXXXXX ////////&ZZڙۼyfߒCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBB?B8t&nnnnnnnnnnnnnnnnnnnnnnnnooooooooooooooooooooooooeo$Ed;;;;;;;;;;;;;;;;;;;;;;;;\\\\\\\\\\\\\\\\\\\\\\\\z$P‶ ~͚!eeeeeeeef>FNNNNNNNNNNNNNNNNNNNNNNNN %_!iiiiiiiiiiiiiiiiiiiiiiiiQQQQQQQQQQQQQQQQQQQQQQQQnnnnnnnnMMMMMMMM||||||||||||||||||||||||888888888888888888888888wwwwwwww+  / )JqllllllllllllllllllllllllA````````````````````````ZYE( ѫOB S *:!!!!!!!!&Z _<a\>>>>>>>QӗUk  NNNNNNNN@DDDDDDDDDDDDDDDDDDDDDDDD********/? =FLOdLXXXXXXXXE:X^^^^^^^^^^^^^^^^^^^^^^^^tttttttttttttttttttttttt555555555555555555555555GfzzzzzzzzzzzzzzzzzzzzzzzzMI2lllllllldUZR(کM444444444444444444444444tttttttt@/ɉ 'RcWWWWWWWWeQg [ig]trѧ 1S{a`Won`W{ ite?' ;꾨-g2~߉- Hq÷Ca!ށuoA6eH81l[Qψ=xx΍ӄ 5~ZMb[&$.YGDN}U}gyF|iMP,ҿO'#kRq URYJw6O D4e*iŋ;;Q! m=[/UWQsYw3Oe7%i yogm#yASEw+u}917;_G{W #YoE/'[#y]EuOAiWguCS=a%#?+o_K#wciKU9g+-uo! 'U{aYWw_!Sa 9]?q[S7;{7-#7{o[E5AUy#'O_MWQCCSa-QmM _s#uce!iCKUg/Y]y?c MU;Y!WW]3 a[?¤ݖS!^k~Ճw8YI(t3HɃX [XE+QA>D%pAr/&-4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q_>>>>>>>ddddddddj b o@JJJJJJJJHHHHHHHHeeeeeeeeeeeeeeee,,,,,,,,xxxxxxxxxxxxxxxx&&&&&&&&~͚! ---------------- &&&&&&&&&&&&&&&&  <<<<<<<<<<<<<<<<   ]........||||||||||||||||@n݀r77777777@RRRRRRRRaaaaaaaa????????lQ/VCye rkkkkkkkkkkkkkkkk@CCCCCCCC ffffffff;;;;;;;;;;;;;;;;''''''''@@OOOOOOOO!!!!!!!!!!!!!!!!(XF@FFFFFFFFFFFFFFFF!!!!!!!!XXXXXXXXXXXXXXXXSSSSSSSS________R}JbbbbbbbbVVVVVVVVVVVVVVVVf>FH"7t#vvvvvvvvvvvvvvvv00000000))))))))))))))))@| aTTSo/>dDDDDDDDD~~~~~~~~@EEEEEEEE rrrrrrrrrrrrrrrrC׀B>>>>>>>>>>>>>>>>IIIIIIIIJJJJJJJJJJJJJJJJ']j6666666666666666}}}}}}}}}}}}}}}}######## BBBBBBBB++++++++sY>NXXXXXXXXXcccccccc?Y^@WWWWWWWWMMMMMMMMMMMMMMMM55555555̍n]aaaaaaaaaaaaaaaa@AAAAAAAAAAAAAAAAk@JKVVVVVVVV1111111111111111 pppppppppppppppp$$$$$$$$mmmmmmmmuuuuuuuu4444444444444444eeeeeeee@[[[[[[[[[[[[[[[[ ................ P7O4`77܇1{ Ӝ [{;g]tSrѧM 1S{9)`mon`W3{ tew' ;꾨qg2~߉)|f ۮHq÷Ca!ޅ]SA6eH8IlYQψUxx΍Ӂm5~ZMbk&$.1GDN} {dVYẸCF|i9P,ҿOo'#QRq URyJw6m D4!*ił3?k,zhgwO Y/lzy!6</0- ls¼E c+t<=FJfETL\]ei9ZmQCqlV[zF Z[;Ҁ?1 #[ ƢsI @m53-[8wi분O.𡹼C{B-Js/}ok ;9Dk{pAr&-4eف&5\.CII4Q7gT me!k\kg޴6{Sa qƇEHzߋzwmV1gɳ7#ћ՜H(cMKOx÷5Y{l_$WPL=RhM cLzi5l,'s)_>3<)~lRҘ+ocAboΙ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