Passphrase can be unicode, in which case you should do:

```python
if isinstance(prefix, unicode):
  prefix = prefix.encode("utf-8")
```