First let's have a look why it is not (yet) possible to mount encrypted userdata partition from TWRP especially on Samsung devices.
Encryption is hardware-backed in TEE and therefore vendor specific. Furthermore ...
... some vendors such as Samsung use their own encryption techniques. Without heavy deconstruction/decompiling of custom library blobs, and successful ports by an active maintainer, this may never be done.
Decryption involves the underlaying firmware. It requires to mount various partitions and running libraries for communication with (TEE) Trusted Execution Environment.
For Qualcomm devices it is necessary to run
qseecomd, for Exynos devices the Trustonic Kinibi daemon. In this example the
modem partition is mounted with
mounttodecrypt flag (qualcomm)
/firmware vfat /dev/block/bootdevice/by-name/modem flags=slotselect;display="Firmware";mounttodecrypt;fsflags=ro
As we can see on this list of libraries also the
vendor partition is mounted. This is also OEM specific content used by LineageOS and not included in TWRP by default. Some recent TWRP builds have it, most builds are designed to use the firmware. However no Samsung devices known. This example is from another qualcomm device not for Samsung:
Now, as we know there is a lot of research to make decryption working, it's obviously TWRP maintainers are desperate overhelmed with providing encryption support for all devices. Therefore decryption is always only a goody, heavily depending on maintainers knowledge and engagement.
That might one reason why android modding scene prefer to run custom ROMs unencrypted
Encryption is forced since Android 5.0 with
forceencrypt= flag in fstab (FDE) or
forcefdeorfbe= are always pointing to crypto footer. Therefore they are interchangeable.
To disable force encryption (FDE) use the first flag. Edit your fstab entry for
userdata partition and replace
/dev/block/platform/11120000.ufs/by-name/USERDATA /data ext4 noatime,nosuid,nodev,discard,errors=panic wait,check,encryptable=footer,length=-20480,reservedsize=128M
This can be done from TWRP by installing
The benefit of having force encryption disabled while keeping the availability for encryption is in the nature of Direct Boot vs Secure Start. Upon first boot, the device creates a randomly generated 128-bit master key and then hashes it with a password and stored salt. The resultant hash is also signed through TEE (such as TrustZone), which uses hash of the signature to encrypt the master key. There are four kinds of encryption states:
On Direct Boot the former one is forced with 'default_password', indeed that's how most android devices still encrypted. (TWRP always probes against 'default_password' and only asking for password if decryption failes.)
If you choose Secure Start from security menu the keystore password is re-created using your current lock screen credentials. downside of this encryption state android won't boot until correct passphrase is entered.
To overcome this the benefits of Secure Start with Direct Boot was merged in (FBE) File-Based Encryption, which was introduced with Android 7.0 and enforced for devices shipped with Android 10+
Be aware there is no way to disable enforcement of (FBE) File-Based Encryption. Therefore the only method left is to disable encryption completely by deleting the
fileencryption= flag from fstab (with no proper replacement). Indeed that is how Magisk does currently when flashed from TWRP.
Universal DM-Verity ForceEncrypt Disk Quota Disabler will disable encryption completely
The only* way to decrypt existing data on Samsung devices is boot into android.
(*there exist investigations to break encryption, however not for Samsung encryption)
If your goal is data recovery from encrypted Samsung device TWRP is not the way to go.