atsign-foundation / at_libraries

Support libraries & dependencies for Atsign's technology
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
38 stars 11 forks source link

feat: Secure atKeys with pass-phrase #703

Open sitaram-kalluri opened 1 month ago

sitaram-kalluri commented 1 month ago

- What I did Support the password protected of atKeys file.

- How I did it

  1. Add pass phrase to the AtOnboardingPreference to capture the pass phrase and propagate it the at_auth and at_chops package to decrypt the atKeys.

  2. In auth_cli_args, add parser options to capture "pass phrase" and "hashing algo type"

  3. In at_onboarding_service_impl.dart, in "_generateAtKeysFile", check if the passPhrase is supplied. If supplied, encrypt the keys with the passphrase.

  4. Removed the at_cli_commons dependency from at_onboarding_cli to prevent from cyclic dependency.

- How to verify it

  1. Added a test to verify the encryption and decryption of atKeys using a passphrase with the argon2id algorithm

  2. A functional test to verify password protected of atKeys file

- Description for the changelog

sitaram-kalluri commented 3 weeks ago

Verified backward compatibility of at_auth and at_chops packages with at_client_sdk and looks fine.

sitaram-kalluri commented 4 days ago

The changes in

At this point, this PR contains changes in at_onboarding_cli. The changes are at_cli_commons are moved to a different branch.