s2s: fix crypt/decrypt + small unit test