• Home
Name Date Size #Lines LOC

..--

entry/12-May-2024-1,1431,015

screenshots/device/12-May-2024-

.gitignoreD12-May-2024121 88

README.mdD12-May-20241.5 KiB3819

README_zh.mdD12-May-20241.3 KiB3719

build-profile.json5D12-May-20241 KiB4341

hvigorfile.jsD12-May-2024174 21

package.jsonD12-May-2024394 2019

README.md

1# Cipher
2
3### Introduction
4
5This sample shows how to use cipher algorithms, including Rivest-Shamir-Adleman (RSA) and Advanced Encryption Standard (AES). The display effect is as follows:
6
7![](screenshots/device/index_en.png) ![](screenshots/device/encrypt_en.png) ![](screenshots/device/decrypt_en.png)
8
9### Concepts
10
11RSA: A public-key cryptosystem that works on two different keys: a public encryption key and a private decryption key.
12
13AES: A block encryption standard established by the U.S. National Institute of Standards and technology (NIST). It is also called Rijndael.
14
15### Required Permissions
16
17N/A.
18
19### Usage
20
211. On the home screen, touch the **Encrypt** button. On the **Encrypt** screen, select an encryption algorithm from the **Encryption Algorithm** drop-down list box, enter the content to be encrypted in the text box, and touch the **Encrypt** button.
22
23   The encrypted content is displayed in the text box below.
24
252. Touch the **Reset** button to clear the content in the text box.
26
273. Touch the **Decrypt** button on the home screen. On the **Decrypt** screen, select a decryption algorithm from the **Decryption Algorithm** drop-down list box, enter the content to be decrypted in the text box, and touch the **Decrypt** button.
28
29   The decrypted content is displayed in the text box below.
30
314. Touch the **Reset** button to clear the content in the text box.
32
33### Constraints
34
35- This sample can only be run on standard-system devices.
36
37- This sample requires DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022) to compile and run.
38

README_zh.md

1# 加解密
2
3### 简介
4
5本示例展示了加解密算法,包括RSA加密算法与AES加密算法。效果图如下:
6
7![](screenshots/device/index.png) ![](screenshots/device/encryption.png) ![](screenshots/device/decrypt.png)
8
9### 相关概念
10
11RSA加密算法:RSA公开密钥密码体制是一种使用不同的加密密钥与解密密钥,由已知加密密钥推导出解密密钥在计算上是不可行的密码体制。
12
13AES加密算法:AES密码学中的高级加密标准,又称Rijndael加密法,是美国联邦政府采用的一种区块加密标准。
14
15### 相关权限
16
17不涉及。
18
19### 使用说明
20
211.点击主页面的**加密**按钮,在加密界面中点击**Encryption Algorithm**下拉选择加密算法,在输入框中输入待加密的内容,点击**加密**
22按钮,下方文本框中显示加密后内容。
23
242.点击**重置**按钮,清除文本框中内容。
25
263.点击主页面的**解密**按钮,在解密界面中点击**Decrypt Algorithm**下拉选择解密算法,在输入框中输入待解密的内容,点击**解密**
27按钮,下方文本框中显示解密后内容。
28
294.点击**重置**按钮,清除文本框中内容。
30
31### 约束与限制
32
331.本示例仅支持在标准系统上运行。
34
352.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。
36
37