[Galaxy S 4 Q&A, Help & Troubleshooting] Digian:
Does this help ?? Log of attempting a failed decrypt/mount in TWRP. I tried to trim the meaningless log data.

$ cat /cache/recovery/last_log

Starting TWRP 3.0.2-0 on 26/09/2016

=> Linking mtab

Renaming regular /etc/recovery.fstab -> /etc/recovery.fstab.bak

Moving /etc/twrp.fstab -> /etc/recovery.fstab

=> Processing recovery.fstab

I:Processing '/boot'

I:Processing '/recovery'

I:Processing '/system'

I:Processing '/data'

I:Setting up '/data' as data/media emulated storage.

I:Created '/sdcard' folder.

I:Can't probe device /dev/block/mmcblk0p26

I:Unable to mount '/data'

I:Actual block device: '/dev/block/mmcblk0p26', current file system: 'auto'

I:Can't probe device /dev/block/mmcblk0p26

I:Unable to mount '/data'

I:Actual block device: '/dev/block/mmcblk0p26', current file system: 'auto'

get_crypt_ftr_info crypto key location: 'footer'

I:Processing '/cache'

I:Processing '/efs1'

I:Processing '/efs2'

I:Processing '/efs3'

I:Processing '/external_sd'

I:Created '/external_sd' folder.

I:Processing '/usbstorage'

I:Created '/usbstorage' folder.

I:Processing '/modem'

I:Processing '/preload'

I:Created '/preload' folder.

I:Backup folder set to '/data/media/TWRP/BACKUPS/xxxxxx'

I:Settings storage is '/data/media'

Updating partition details...

I:Unable to mount '/usbstorage'

I:Actual block device: '', current file system: 'vfat'

...done

Unable to mount storage

I:Unmounting main partitions...

Partition Logs:

/boot | /dev/block/mmcblk0p14 | Size: 20MB

Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img

Primary_Block_Device: /dev/block/mmcblk0p14

Display_Name: Boot

Storage_Name: boot

Backup_Path: /boot

Backup_Name: boot

Backup_Display_Name: Boot

Storage_Path: /boot

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/recovery | /dev/block/mmcblk0p15 | Size: 20MB

Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img

Primary_Block_Device: /dev/block/mmcblk0p15

Display_Name: Recovery

Storage_Name: recovery

Backup_Path: /recovery

Backup_Name: recovery

Backup_Display_Name: Recovery

Storage_Path: /recovery

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/system | /dev/block/mmcblk0p23 | Size: 2244MB Used: 751MB Free: 1492MB Backup Size: 751MB

Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent

Primary_Block_Device: /dev/block/mmcblk0p23

Display_Name: System

Storage_Name: System

Backup_Path: /system

Backup_Name: system

Backup_Display_Name: System

Storage_Path: /system

Current_File_System: ext4

Fstab_File_System: auto

Backup_Method: files

/data | /dev/block/mmcblk0p26 | Size: 12097MB

Flags: Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Is_Encrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage

Symlink_Path: /data/media

Symlink_Mount_Point: /sdcard

Primary_Block_Device: /dev/block/mmcblk0p26

Length: -16384

Display_Name: data

Storage_Name: Internal Storage

Backup_Path: /data

Backup_Name: data

Backup_Display_Name: Data

Storage_Path: /data/media

Current_File_System: emmc

Fstab_File_System: auto

Backup_Method: dd

MTP_Storage_ID: 65537

/cache | /dev/block/mmcblk0p24 | Size: 344MB Used: 5MB Free: 338MB Backup Size: 5MB

Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent

Primary_Block_Device: /dev/block/mmcblk0p24

Display_Name: Cache

Storage_Name: Cache

Backup_Path: /cache

Backup_Name: cache

Backup_Display_Name: Cache

Storage_Path: /cache

Current_File_System: ext4

Fstab_File_System: auto

Backup_Method: files

/efs1 | /dev/block/mmcblk0p11 | Size: 14MB

Flags: Can_Be_Backed_Up Has_SubPartition IsPresent

Primary_Block_Device: /dev/block/mmcblk0p11

Display_Name: EFS

Storage_Name: EFS

Backup_Path: /efs1

Backup_Name: efs1

Backup_Display_Name: EFS

Storage_Path: /efs1

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/efs2 | /dev/block/mmcblk0p12 | Size: 3MB

Flags: Can_Be_Backed_Up Is_SubPartition IsPresent

SubPartition_Of: /efs1

Primary_Block_Device: /dev/block/mmcblk0p12

Display_Name: efs2

Storage_Name: efs2

Backup_Path: /efs2

Backup_Name: efs2

Backup_Display_Name: efs2

Storage_Path: /efs2

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/efs3 | /dev/block/mmcblk0p13 | Size: 3MB

Flags: Can_Be_Backed_Up Is_SubPartition IsPresent

SubPartition_Of: /efs1

Primary_Block_Device: /dev/block/mmcblk0p13

Display_Name: efs3

Storage_Name: efs3

Backup_Path: /efs3

Backup_Name: efs3

Backup_Display_Name: efs3

Storage_Path: /efs3

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

/preload | /dev/block/mmcblk0p25 | Size: 98MB Used: 4MB Free: 94MB Backup Size: 4MB

Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent

Primary_Block_Device: /dev/block/mmcblk0p25

Display_Name: Preload

Storage_Name: Preload

Backup_Path: /preload

Backup_Name: preload

Backup_Display_Name: Preload

Storage_Path: /preload

Current_File_System: ext4

Fstab_File_System: ext4

Backup_Method: files

I:Loading package: TWRP (/twres/ui.xml)

I:Loading pages...

I:Loading page main

I:Loading page main2

I:Loading page install

I:Loading page flash_confirm

I:Loading page flash_zip

I:Loading page flash_done

I:Loading page flashimage_confirm

I:Loading page clear_vars

I:Loading page confirm_action

I:Loading page action_page

I:Loading page singleaction_page

I:Loading page action_complete

I:Loading page filecheck

I:Loading page rebootcheck

I:Loading page wipe

I:Loading page advancedwipe

I:Loading page formatdata

I:Loading page formatdata_confirm

I:Loading page checkpartitionlist

I:Loading page partitionoptions

I:Loading page refreshfilesystem

I:Loading page selectfilesystem

I:Loading page backup

I:Loading page backup_options

I:Loading page backupname1

I:Loading page backupname2

I:Loading page backupencryption

I:Loading page backupencryption2

I:Loading page checkbackuppassword

I:Loading page backup_run

I:Loading page restore

I:Loading page restore_read

I:Loading page restore_decrypt

I:Loading page try_restore_decrypt

I:Loading page restore_select

I:Loading page renamebackup

I:Loading page restore_run

I:Loading page mount

I:Loading page usb_mount

I:Loading page usb_umount

I:Loading page system_readonly_check

I:Loading page reboot

I:Loading page system_readonly

I:Loading page settings

I:Loading page settings_timezone

I:Loading page settings_screen

I:Loading page settings_vibration

I:Loading page settings_language

I:Loading page advanced

I:Loading page partsdcardsel

I:Loading page partsdcardcheck

I:Loading page partsdcard

I:Loading page htcdumlock

I:Loading page lock

I:Loading page filemanagerlist

I:Loading page filemanageroptions

I:Loading page choosedestinationfolder

I:Loading page filemanagerrenamefile

I:Loading page filemanagerrenamefolder

I:Loading page filemanagerchmod

I:Loading page filemanagerconfirm

I:Loading page filemanageraction

I:Loading page decrypt

I:Loading page decrypt_pattern

I:Loading page trydecrypt

I:Loading page terminalcommand

I:Loading page sideload

I:Loading page fixcontexts

I:Loading page installsu

I:Loading page slideout

I:Loading page select_storage

I:Loading page select_language

I:Switching packages (TWRP)

Renaming regular /file_contexts -> /file_contexts.bak

Moving /prebuilt_file_contexts -> /file_contexts

SELinux contexts loaded from /file_contexts

Full SELinux support is present.

I:Not using /misc, not defined in fstab.

ro.cwm.forbid_mount=/boot

ro.cwm.forbid_format=/boot,/firmware,/firmware-modem

ro.boot.bootloader=I9506XXUDOK1

ro.twrp.boot=1

ro.twrp.version=3.0.2-0

ro.board.platform=msm8974

ro.build.date=Mon Apr 4 19:14:12 EDT 2016

ro.build.product=ks01lte

ro.build.selinux=1

ro.build.version.sdk=22

ro.product.cpu.abi=armeabi-v7a

ro.product.cpu.abi2=armeabi

ro.product.board=MSM8974

ro.product.brand=samsung

ro.product.model=GT-I9506

ro.product.device=ks01lte

ro.telephony.ril_class=KslteRIL

ro.bootloader=I9506XXUDOK1

ro.modversion=12.1-20160404-UNOFFICIAL-ks01lte

I: Copying file /cache/recovery/log to /cache/recovery/last_log

I: Is encrypted, do decrypt page first

I: Switching packages (TWRP)

I: Set page: 'decrypt'

I: Set page: 'trydecrypt'

I: operation_start: 'Decrypt'

crypt_ftr->fs_size = 24776639

Using scrypt with keymaster for cryptfs KDF

could not find any keystore module

Failed to init keymaster

Signing failed

kdf failed

failure decrypting master key

Failed to decrypt master key

crypt_ftr->fs_size = 24776639

Using scrypt with keymaster for cryptfs KDF

could not find any keystore module

Failed to init keymaster

Signing failed

kdf failed

failure decrypting master key

Failed to decrypt master key

Failed to decrypt data.

I: Set page: 'decrypt'

I: operation_end - status=1

I: Set page: 'main'

I: Set page: 'clear_vars'

I: Set page: 'main2'

I: Set page: 'main'

I: Set page: 'clear_vars'

I: Set page: 'main2'

I: Unable to mount settings storage during GUI startup.

I: Cannot load settings -- encrypted.

I: PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly

parsing languageFile

parsing languageFile done

I: Translating partition display names

I: Backup folder set to '/data/media/TWRP/BACKUPS/xxxxxxx'

I: TWFunc::Fixup_Time: Pre-fix date and time: 2014-01-01--05-55-32

I: TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch

I: TWFunc::Fixup_Time: will attempt to use the ats files now.

I: Switching packages (TWRP)

I: Set page: 'system_readonly'

I: Is_Mounted: Unable to find partition for path '/vendor'

I: operation_start: 'Toggle System Mount'

I: operation_end - status=1

I: Set page: 'main'

I: Set page: 'clear_vars'

I: Set page: 'main2'

I: Set page: 'main'

I: Set page: 'clear_vars'

I: Set page: 'main2'

I: Switching packages (TWRP)

I: Set page: 'main'

I: Set page: 'clear_vars'

I: Set page: 'main2'

I: Set page: 'reboot'

I: Set page: 'rebootcheck'

I: Copying file /cache/recovery/log to /cache/recovery/last_log

Rebooting...