added encrypt and decrypt for long and short keys