SF2 encode password algorithm