Replace random_bytes with hex method to generate random encrypt key since random_bytes can result in unexpected shell behavior passing it via stdin.