Back

Encrypt String Attribute in collection

  • 0
  • Databases
Drake
19 Sep, 2023, 01:28

Honestly, I haven't tried it

TL;DR
User is experiencing an issue with encrypting a string attribute in a collection. The encrypted data is getting truncated and not decrypting properly. User requests creating an issue to handle smaller strings. User confirms that the data is indeed encrypted. Another user suggests trying with a longer string. User receives the same error when setting a default value or setting a non-required attribute. Disabling the encrypt attribute allows it to work again. User encounters an error when querying the attribute. User hasn't tried indexing the string attribute. User believes it should work. Solution: Disable the encrypt attribute for the string attribute in order to resolve the issue.
Drake
19 Sep, 2023, 01:28

It should work though

Joshi
19 Sep, 2023, 01:28

String won't be able to index tho, right?

Drake
19 Sep, 2023, 01:29

You mean you can't query? If so, that's correct

Joshi
19 Sep, 2023, 01:29

yes.

Joshi
19 Sep, 2023, 01:30

@Steven I'll try and report back

Joshi
19 Sep, 2023, 01:43

@Steven This is what I get

Joshi
19 Sep, 2023, 01:44

Entering any string will result in this error

Joshi
19 Sep, 2023, 01:44

Disabling the encrypt attribute makes it work again

Drake
19 Sep, 2023, 01:45

Did you create the attribute as encrypted?

Joshi
19 Sep, 2023, 01:46
Drake
19 Sep, 2023, 01:47

Odd...

Joshi
19 Sep, 2023, 01:47

It just says invalid type

Joshi
19 Sep, 2023, 01:49

@Steven Same error when I set required to false or a default value

Drake
19 Sep, 2023, 01:51

Can you try with a bigger size? Like 256

Joshi
19 Sep, 2023, 06:51

@Steven it works

Joshi
19 Sep, 2023, 06:51

lmao ur the G mate @Steven

Joshi
19 Sep, 2023, 06:52

And its confirmed that it is encrypted as well

Joshi
19 Sep, 2023, 06:52
Joshi
19 Sep, 2023, 06:55

Value was "hi" and resulted in 125 letters, if I insert a longer value I get the same error

Joshi
19 Sep, 2023, 07:27

Somewhat related: I just did several benchmarks and the performance is pretty much the same for Inserting, Reading and Fetching. Server Architecture: ARM

Drake
19 Sep, 2023, 19:20

same between encrypted vs unencrypted?

Drake
19 Sep, 2023, 19:21

would you please create an issue so that we make sure we handle the case for smaller strings?

Drake
19 Sep, 2023, 19:22

im assuming we don't handle the size correctly so the encrypted data gets truncated and so it doesn't decrypt properly

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more