I have answered this very question probably a hundred times in 4 Years.
So instead of wasting time rewriting it all, i made video on how to do it on YouTube.
Instead of just Self Promoting that video as some would see it, Here goes 101.
Remove Battery or Turn Off the Device
Go into Memory Test Tab - SPFT
Tick Whatever Options are Available - Just make ...
to answer the headline, there exist a little shell script twrp_sign.sh for generating data.info and sha2 digest. you can open it with text editor and see how it works
data.info is just a string containing
Note: only the .win* files are important, all other files can be safely deleted without data loss
I'm not sure yet whether this works on non-Google phones, but on my Pixel 2 and Nexus 5, the backup feature (under Settings -> System -> Backup -> (Choose profile, if relevant) -> Pixel 2 backup) shows that SMS text messages are included in the Google Drive backup, if you have enabled it. You cannot directly download or view the backup from Google Drive/PC, ...
i guess your real purpose of this question is not what the headline suggests - secure erase your data - but instead you want to have a full backup of userdata including /data/media (downvote if i am wrong)
you have some options, most require additional binaries which you can copy to /cache partition or permanently integrate into your twrp /sbin