Skip to content

Instantly share code, notes, and snippets.

@arvindkalra
Last active August 7, 2019 19:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arvindkalra/31524b1171715b38ce3d07eaaf36618e to your computer and use it in GitHub Desktop.
Save arvindkalra/31524b1171715b38ce3d07eaaf36618e to your computer and use it in GitHub Desktop.
Ursula - nucypher ursula run --dev --federated-only
Alice - nucypher alice run --dev --federated-only --teacher 127.0.0.1:10151
Bob - nucypher bob run --dev --federated-only --teacher 127.0.0.1:10151 --controller-port 4000
Enrico - nucypher enrico run --policy-encrypting-key <Key from Policy Creation> --http-port 5000
Create Policy -
POST
localhost:8151/derive_policy_encrypting_key/<Label>
Grant -
PUT
localhost:8151/grant
{
"bob_encrypting_key": "039170b61f1aac6b3e677bb3254b80a4aa3ce9416b6bfa0038aaeb94292c1d45a5",
"label": "ethindia",
"m": 1,
"n": 1,
"expiration" : "2019-09-15T15:53:00",
"bob_verifying_key": "034ee31d92c511701bba1bd78b724370127e22d633d65bfcd2033a4031219177f6"
}
Encrypt -
POST
localhost:5000/encrypt_message
{
"message": "test message World"
}
Decrypt -
POST
localhost:4000/retrieve
{
"policy_encrypting_key": "037efc6e8a3f0cf58d8f47421d6cd31bb7379889b09715af8771f42ecd90ea9ee3",
"alice_verifying_key": "032f9d35464a75c6edfe7ce29bb386fd8fa1cc17a614aad0b91f714a7563fe621b",
"label": "ethindia",
"message_kit": "A6CLmOoKPsQoO/p+ZMDxRCM29LpavTKJ5jadPFOmalaTApGCioxXMI5n1r4ZwXSNO8j+ywOGIT3U6L9ueW6Sp1eHhEvtTzuUgoea9G3wD3wOdZgQQDCfjPtot28Znlh6K78CIi/0KIAU9PzNDoRMSMh4ylbMqMuitOOkYLyNZWvqNz8Uad++q1yK2ENvzZX2m6/eYziDWS3ITKGi7VVqXphnF/puHkU2yhfhl7Hlqx/vJYfB/L6V2tq/3NAnbA42/YY1scFeBLq9dV4vOUTYoxAv5JD6MSdFTA9gB3QSgMOvde49CsV99hzQIma7urzxZnQFrTe/df1Y"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment