key generation encoding bugfix
simplyfied rc4 crypto