cifer-sdk / examples

Web2 Integration

Demonstrates all web2.* functions from the CIFER SDK. No blockchain wallet needed — uses email registration and Ed25519 session signing.

Recommended flow: Register → Session → Secrets → Encrypt/Decrypt
web2.auth

Register

Create a new account with email and password. Verify via OTP and register an Ed25519 key for session signing.

register()verifyEmail()registerKey()resendOtp()
View Example →
web2.session

Session

Create a managed session using your Ed25519 key. Sessions are auto-renewable and required for all authenticated operations.

createManagedSession()
View Example →
web2.secret

Secrets

Create new Web2 secrets and list all secrets owned by your principal. Secrets are used for encryption/decryption.

createSecret()listSecrets()
View Example →
web2.delegate

Delegate

Set or remove a delegate for a Web2 secret. Delegates can encrypt/decrypt data using your secret.

setDelegate()
View Example →
web2.permit

Permit

Request permits for key rotation (email+password), secret transfer, or delegation operations.

requestPermit()
View Example →
web2.principal

Principal Lookup

Look up a principal by email address. Returns the principal UUID and email hex.

getByEmail()
View Example →
web2.blackbox.payload

Payload Encrypt / Decrypt

Encrypt a plaintext message and decrypt it on one page. Encryption results are auto-populated into the decrypt inputs.

encryptPayload()decryptPayload()
View Example →
web2.blackbox.files

File Encrypt / Decrypt

Encrypt a file into a .cifer.zip and decrypt it back — all on one page. Each operation runs as a background job.

encryptFile()decryptFile()pollUntilComplete()download()
View Example →
web2.blackbox.jobs

Data Consumption

View encryption and decryption usage stats, plan limits, and remaining quota for the current billing period.

dataConsumption()
View Example →

State is shared across pages via React Context. Register first, then navigate to other pages to use your session.