Self-synchronizing cipher