Can't create CryFS encrypted volume due to high memory usage #23
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hardcoresushi/DroidFS#23
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I can't create CryFS encrypted volume, neither ordinary or hidden. I tried all possible locations (DroidFS internal, phone, SD card). The error I got is "The volume creation has failed".
GocryptFS works fine.
DroidFS versions tried: 2.1.0 and 2.1.2 (both installed via F-droid)
Android version: 8.1.0
Unfortunatly I cannot reproduce. It would be very helpful if you could show the logcat.
How long the message "Creating volume..." is displayed before showing the error?
Can you reproduce the issue with the APKs provided here?
I tried the "universal" APK - still the same result. Unfortunately, I'm not a programmer, and I can't provide the logcat.
In the majority of cases this time is a fraction of a second, with one or two exceptions (for instance: the first time I tried to use aes-256, the "Creating volume..." message was displayed for about two seconds, followed by error, and on the second try (immediately after the first one), this time was considerably shorter.
Here are some screenshots:
https://i.postimg.cc/tC3vb2cf/Screenshot-20230928-080847.png
https://i.postimg.cc/RCnbsMLv/Screenshot-20230928-080851.png
https://i.postimg.cc/CLTr9Wck/Screenshot-20230928-080911.png
https://i.postimg.cc/XYx2GX4k/Screenshot-20230928-094857.png
I'm standing by for further assistance.
OK, that's hard to tell what's the problem without seeing the logcat. Can't you use
adb
or LogFox?Do you have the same issue with different ciphers and different passwords (including empty)?
Sorry for the slow response, in the attached file is what I got.
The package is DroidFS-v2.1.2-universal.apk, directly downloaded from here.
(Just tried DroidFS-v2.1.3-universal.apk - same behaviour.)
Yes, all the ciphers and password lenghts (empty password, 1,3,8, 10 character) I tried failed.
Thank you very much. The only relevant line I spot in the provided logs is the following:
I think cryfs is failing to allocate enough memory for the scrypt derivation of the password.
How much memory does your device have? Are you using memory-hungry applications at the same time as DroidFS?
Are you using any special memory features from your ROM or other applications (such as memory usage constraints)?
At the moment of writing: 3 Gb total memory, 1.7 Gb used.
What did you say? ;-)
Smartphone related: I'm an ordinary, dumb user and I don't do anything unusual. Usually there are browser (Vivaldi), messenger (Threema), non-root firewall and e-mail client napping in the background.
How many processor cores does your device have?
Can you try to close all running applications (force close if necessary), then try again to create a cryfs volume?
On my 8-core device, DroidFS memory usage increases to around 600 MB during CryFS password derivation. You can run
top
in a terminal on your device (or overadb
) to see how much memory DroidFS is using (check theRES
column).I managed to free about 100 Mb of RAM killing whatever I saw - nothing changed. Memory used by the droidFS process never exceeds 130 Mb, as long as I can see it in
top
. I'm attaching a screenshot. My device has 4 processor cores.Does this also happen when opening an existing cryfs volume? (For example, creating a volume with the original cryfs program on the desktop, then trying to open it with DroidFS).
Can you try to reproduce the bug with gocryptfs, by editing the scrypt parameters in the
gocryptfs.conf
file? The default parameters used by cryfs are:However, gocryptfs doesn't allow
r
to be less than 8. Maybe you could try with:Please excuse my extreme delay!
Yes, but the error is different: "Open failed. Unknown error code: 0"
This particular volume was created on fairly modern phone, 8 cores/8 gigs RAM, using the DroidFS itself. I'm attaching the log captured (01-11_20-12-55.log)
I tried using the second set of parameters (those with "r": 8), and I got a DroidFS crash - all the three log files I obtained are attached too. I hope they can provide some information.
I'm standing by for any further assistance.
Interesting. The logcat when opening a volume shows the same error:
If it crashed with gocryptfs then it's definitely a scrypt issue. Unfortunately, CryFS has not be designed to run on mobile devices and there are no ways to change the scrypt parameters at the moment. However, this is a TODO feature in DroidFS. When implemented, you will be able to reduce CryFS scrypt parameters and so create CryFS volumes.
Corresponding CryFS issue: https://github.com/cryfs/cryfs/issues/349
Can't create CryFS encrypted volumeto Can't create CryFS encrypted volume due to high memory usage