introduction
In a wireless LAN, the transmission medium is mainly radio waves and infrared rays. Any eavesdropper with receiving ability may intercept the data in the wireless channel, grasp the content of the transmission, and cause data leakage. Therefore, for wireless LAN, data encryption is one of the key technologies.
AVR high-speed embedded microcontroller is an 8-bit RISC MCU. It only takes one clock cycle to execute most instructions. It is fast (the running speed of 8MHz AVR is approximately equal to that of 200MHz C51). 32 general registers are directly connected to ALU to eliminate the bottleneck of operation. It has built-in Flash and EPPROM that can be serially downloaded or self-programmed, with many functions and multiple operating modes.
According to the 802.11 wireless LAN protocol standard released by IEEE in 1999, the wireless data transmission device was developed using Atmel's Atmega128 high-speed embedded single-chip microcomputer. In order to achieve the security of wireless data transmission and save costs as much as possible, software is used for encryption and decryption. This puts high demands on the simplicity, high speed and adaptability of the algorithm. The two new block encryption algorithms RC5 and RC6 can better meet the above requirements.
1 RC5 and RC6 algorithms
1.1 Parameters of RC5 and RC6
RC5 and RC6 are parameter variable grouping algorithms, which are actually a family of encryption algorithms determined by three parameters. A specific RC5 or RC6 can be expressed as RC5-w/r/b or RC6-w/r/b. The three parameters w, f and b are defined as listed in Table 1.
Table 1 RC5 and RC6 algorithm parameter definitions
Parameters | Definition | Commonly used |
w | Word size in bits | 16,32,64 |
r | Number of encryption rounds | 0~255 |
b | The length of the key in bytes | 0~255 |
1.2 RC5 and RC6 word operation components
Both RC5 and RC6 consist of three parts: the mixed key generation process, the encryption process, and the decryption process. In these two algorithms, a total of six basic operations are used:
① Modulo 2w addition operation, represented by "+";
② Modulo 2w subtraction operation, represented by "-";
③ Bit-by-bit XOR operation, expressed as +;
④ Circular left shift: word a is circularly shifted left by b bits as “a<<
⑤ Circular right shift: word a is circularly shifted right by b bits as “a>>>b”;
⑥ Modulo 2w multiplication, expressed as “×”.
The RC5 algorithm uses the above-mentioned ① to ⑤ calculation parts, and the RC6 algorithm uses all of the above-mentioned calculation parts.
1.3 RC5 Algorithm
(1) Pseudocode representation of the RC5 algorithm hybrid key generation process
S[0]=Pw
for i=1 to t-1 do
S[i]=S[i-1]+Qw
Input user keys K[0] to K[b-1] with a bit size of 8 and a key length of b
Convert K[0] to K[b-1] to an L[] array with length c and number of bits w
i=j=0 x=y=0
do 3×max(t,c)times:
S[i]=(S[i]+x+y)<<<3;X=S[i];i=(i+1)mod t
L[j]=(L[j]+x+y)<<<(x,y);X=L[j];j=(j+1)modC
Where c = [b × 8 / w] square brackets indicate the rounding operation, t = 2r + 2, when w is 16, 32, 64, respectively, the constants Pw, Qw are listed in Table 2.
Table 2 Constants Pw, Qw value table
W | 16 | 32 | 64 |
P | 0xB7E1 | 0xB7E15163 | 0xB7E151628AED2A6B |
QUR | 0x9E37 | 0x9E3779B9 | 0x9E3770B97F4A7C15 |
(2) Pseudocode representation of the RC5 encryption algorithm process
Input(A,B)
A=A+S(0)B=B+S[1]
for i=1 to r do
A=((A+B)<<
Previous article:Atmega128 MCU CRC check code table lookup and direct generation
Next article:Application of AVR single chip microcomputer in digital signal processing of frequency hopping system
Recommended ReadingLatest update time:2024-11-16 15:36
- Popular Resources
- Popular amplifiers
- Electrical and Electronic Technology (Editors-in-Chief: Liu Yaoyuan, Hu Minshan; Associate Editors-in-Chief: Zou Xiaolian, Zhou Hongyu, Li Heshui)
- Fundamentals of Circuit Analysis (Fourth Edition) (Editor-in-Chief Fu Yuming; Associate Editors Chen Xiao and Zhang Xiaomei)
- 电路原理 (韩冬编著)
- Fundamentals of Analog Electronics Technology (Edited by Wu Tuo; Deputy Editors: Yi Yajun and Liu Sumei)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- FatFs transplantation based on SPI for MSP430F5438A microcontroller
- Problem with STM32F767 timer overflow interrupt flag
- Comparison of the advantages of digital cameras and analog cameras in machine vision system design
- About the external interrupt of HAL library
- Playing with circuits (4) - UC3843 floating buck, 60W efficiency 93%
- Sinlinx A33 Development Board Linux Interrupt Programming 1--- Principle Description
- This week's highlights
- Xiaomi has eliminated China's copycat mobile phones in just 9 years since its founding. Do you agree?
- A brief discussion on processes and threads
- Light Sabers and Light Sabers Made with CPX