Fixed encryption flaw