I decided to try encryption on my Samsung Galaxy Tab Pro 8.4 wifi version just for fun. But during encryption process (somewhere at the end) it turned off the screen and hung.
Anyway my tablet was encrypted, but I wasn't asked for setting a password or encryption key. And it's appeared to be hard to do a factory reset on an encrypted device, since I have Cyanogenmod instead of stock ROM and TWRP instead of stock recovery. Any "official" way to hard reset the tablet was unsuccessful - for some of them I was asked for decryption (I don't have a password) and for the other TWRP recovery was unsuitable - it just led to an infinite boot loop.
So how can I do a factory reset?