1# Basic Security Capability Development 2 3 4## What is the maximum number of bytes that can be encrypted at a time in AES GCM mode in HUKS? (API version 9) 5 6**Solution** 7 8In HUKS, a maximum of 64 bytes can be encrypted at a time in AES GCM mode. 9 10**Example** 11 12``` 13/* Encrypt the key. */ 14await huks.init(srcKeyAlias, encryptOptions).then((data) => { 15 console.info(`test init data: ${JSON.stringify(data)}`); 16 handle = data.handle; 17}).catch((err) => { 18 console.info('test init err information: ' + JSON.stringify(err)); 19}); 20encryptOptions.inData = aesCipherStringToUint8Array(cipherInData.slice (0,64)); // Take 64 bytes. 21await huks.update(handle, encryptOptions).then(async (data) => { 22 console.info(`test update data ${JSON.stringify(data)}`); 23 encryptUpdateResult = Array.from(data.outData); 24}).catch((err) => { 25 console.info('test update err information: ' + err); 26}); 27encryptOptions.inData = aesCipherStringToUint8Array(cipherInData.slice (64,80)); // Remaining data 28``` 29 30 31## What do I do if garbled characters are returned by Md.digest() of cryptoFramework? (API version 9) 32 33**Symptom** 34 35When **digest()** of **Md** in the **cryptoFramework** module is called, garbled characters are returned. 36 37**Solution** 38 39The DataBlob returned by **digest()** is of the Uint8Array type and needs to be converted into a hexadecimal string before being printed. You can use the online MD5 encryption tool to verify the result. 40 41## How do I customize the text on the options displayed for requesting a permission? (API version 10) 42 43**Solution** 44 45Only **reason** can be customized. The text on the options displayed cannot be customized. 46 47**Reference** 48 49[Workflow for Requesting Permissions](../security/AccessToken/determine-application-mode.md) 50 51## Are synchronous APIs provided by @ohos.security.cryptoFramework? Will synchronous APIs be provided in the future? (API version 10) 52 53**Solution** 54 551. Currently, all the JS APIs provided by the cryptoFramework module are implemented in asynchronous mode. 56 572. Synchronous encryption and decryption APIs will be provided in later versions. 58 59## When and how do I use SaveButton? What are the differences between using SaveButton and using a Picker? (API version 10) 60 61**Solution** 62 631. You can integrate **SaveButton** into your application and register the **onClick** callback. When a user taps **SaveButton**, the application calls the **mediaLibrary** API in the callback to quickly save an image. During this process, operations such as authorization via a dialog box and selecting the directory for saving the image are not required. 642. You can use this component when your application needs to save images or videos to the media library. 653. This component allows for simpler operations than Pickers, which have to start a system application and have the user select a directory for saving the image or video. 66 67**Reference** 68 69[Security Component Overview](../security/AccessToken/security-component-overview.md) 70 71[SaveButton](../reference/apis-arkui/arkui-ts/ts-security-components-savebutton.md) 72 73