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