Skip to content

Instantly share code, notes, and snippets.

@mnixry
Created October 6, 2022 14:53
Show Gist options
  • Save mnixry/9657bb1fb4cbb0f73c18076642555371 to your computer and use it in GitHub Desktop.
Save mnixry/9657bb1fb4cbb0f73c18076642555371 to your computer and use it in GitHub Desktop.
Encode Novel AI account e-mail & password set into login key.
from nacl import encoding, hash, pwhash
username = b"" # Input your email and password here
password = b""
result = pwhash.argon2id.kdf(
size=64,
password=password,
salt=hash.generichash(
password[:6] + username + b"novelai_data_access_key",
digest_size=pwhash.argon2id.SALTBYTES,
encoder=encoding.RawEncoder,
),
opslimit=2,
memlimit=2000000,
encoder=encoding.URLSafeBase64Encoder,
)[:64]
print(result) # Your access key will appear here
# You just need to login in API document: https://api.novelai.net/docs
@Danipulok
Copy link

Thanks a lot, mate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment