| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| AppScope/ | 22-Oct-2025 | - | 35 | 32 | ||
| entry/ | 22-Oct-2025 | - | 1,403 | 1,144 | ||
| hvigor/ | 22-Oct-2025 | - | 38 | 36 | ||
| screenshots/ | 22-Oct-2025 | - | ||||
| .gitignore | D | 22-Oct-2025 | 133 | 12 | 12 | |
| README.md | D | 22-Oct-2025 | 4 KiB | 85 | 65 | |
| build-profile.json5 | D | 22-Oct-2025 | 1.4 KiB | 58 | 57 | |
| code-linter.json5 | D | 22-Oct-2025 | 958 | 35 | 34 | |
| hvigorfile.ts | D | 22-Oct-2025 | 843 | 22 | 5 | |
| oh-package.json5 | D | 22-Oct-2025 | 834 | 26 | 24 | |
| ohosTest.md | D | 22-Oct-2025 | 1.2 KiB | 12 | 10 |
README.md
1# 使用AES对称密钥加解密(C/C++) 2 3### 介绍 4 5本示例主要展示了使用AES对称密钥(C/C++)GCM模式、CCM模式、CBC模式、ECB模式以及GCM模式分段加解密场景 。该工程中展示的代码详细描述可查如下链接。 6 7- [使用AES对称密钥(GCM模式)加解密(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/CryptoArchitectureKit/crypto-aes-sym-encrypt-decrypt-gcm-ndk.md) 8- [使用AES对称密钥(CCM模式)加解密(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/CryptoArchitectureKit/crypto-aes-sym-encrypt-decrypt-ccm-ndk.md) 9- [使用AES对称密钥(CBC模式)加解密(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/CryptoArchitectureKit/crypto-aes-sym-encrypt-decrypt-cbc-ndk.md) 10- [使用AES对称密钥(ECB模式)加解密(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/CryptoArchitectureKit/crypto-aes-sym-encrypt-decrypt-ecb-ndk.md) 11- [使用AES对称密钥(GCM模式)分段加解密(C/C++)](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/CryptoArchitectureKit/crypto-aes-sym-encrypt-decrypt-gcm-by-segment-ndk.md) 12 13### 效果预览 14 15| 首页效果图 | 执行结果图 | 16| ------------------------------------------------------------ | ------------------------------------------------------------ | 17| <img src="./screenshots/EncryptionDecryptionGuidanceAes1.png" style="zoom: 50%;" /> | <img src="./screenshots/EncryptionDecryptionGuidanceAes2.png" style="zoom: 50%;" /> | 18 19### 使用说明 20 211. 运行Index主界面。 222. 页面呈现上述执行结果图效果,点击不同按钮可以跳转到不同功能页面,点击跳转页面中按钮可以执行对应操作,并更新文本内容。 233. 运行测试用例EncryptionDecryptionGuidanceAes.test.ets文件对页面代码进行测试可以全部通过。 24 25### 工程目录 26 27``` 28entry/src/ 29 ├── main 30 │ ├── cpp 31 │ │ ├── types 32 │ │ | ├── libentry 33 │ │ | ├── index.d.ts 34 │ │ | ├── oh-package.json5 35 │ │ | ├── project 36 │ │ | ├── aes_cbc_encryption_decryption.cpp 37 │ │ | ├── aes_ccm_encryption_decryption.cpp 38 │ │ | ├── aes_ecb_encryption_decryption.cpp 39 │ │ | ├── aes_gcm_encryption_decryption.cpp 40 │ │ | ├── aes_gcm_segment_encryption_decryption.cpp 41 │ │ | ├── file.h 42 │ │ ├── CMakeList.txt 43 │ │ ├── napi_init.cpp 44 │ ├── ets 45 │ │ ├── entryability 46 │ │ ├── entrybackupability 47 │ │ ├── pages 48 │ │ ├── Index.ets // 使用AES对称密钥加解密(C/C++)示例代码 49 │ ├── module.json5 50 │ └── resources 51 ├── ohosTest 52 │ ├── ets 53 │ │ └── test 54 │ │ ├── Ability.test.ets 55 │ │ ├── EncryptionDecryptionGuidanceAes.test.ets // 自动化测试代码 56 │ │ └── List.test.ets 57``` 58 59### 相关权限 60 61不涉及。 62 63### 依赖 64 65不涉及。 66 67### 约束与限制 68 691.本示例仅支持标准系统上运行, 支持设备:RK3568。 70 712.本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。 72 733.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。 74 75### 下载 76 77如需单独下载本工程,执行如下命令: 78 79```` 80git init 81git config core.sparsecheckout true 82echo code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAes > .git/info/sparse-checkout 83git remote add origin https://gitee.com/openharmony/applications_app_samples.git 84git pull origin master 85````