ssbc / ssb-keys

keyfile operations for ssb
36 stars 26 forks source link

Rewrite secret file to warn users against copying #63

Closed christianbundy closed 4 years ago

christianbundy commented 4 years ago

Problem: I keep seeing new SSB users who want same-as and decide to experiment with copying their secret file to multiple devices at the same time. This seems like it should work, and this sort of hacky ethos would usually be encouraged, but it's risky and will inevitably fork the feed.

Solution: Rewrite the secret file to move the warnings to the top, adding a warning about copying the secret file to a second device.

Result:

# WARNING: Do not edit, share, or use this file on two devices at once.
#
# This is your SECRET, it gives you magical powers. With your secret you can
# sign your messages so that your friends can verify that the messages came
# rom you. If anyone learns your secret, they can use it to impersonate you.
#
# If you use this secret on more than one device you will create a fork and
# your friends will stop replicating your content.
#
{
  "curve": "ed25519",
  "public": "evXQK4uP4BkgvpZuaIsPXzfNWPkRooxD4knkYuqRdIg=.ed25519",
  "private": "H/99s8PVe9MgExXfI4uaVuHjAGdB45aB3cSgv/6cSp169dAri4/gGSC+lm5oiw9fN81Y+RGijEPiSeRi6pF0iA==.ed25519",
  "id": "@evXQK4uP4BkgvpZuaIsPXzfNWPkRooxD4knkYuqRdIg=.ed25519"
}
#
# The only part of this file that's safe to share is your public name:
#
#   @evXQK4uP4BkgvpZuaIsPXzfNWPkRooxD4knkYuqRdIg=.ed25519
christianbundy commented 4 years ago
# WARNING: Never show this to anyone.
# WARNING: Never edit it or use it on multiple devices at once.
#
# This is your SECRET, it gives you magical powers. With your secret you can
# sign your messages so that your friends can verify that the messages came
# from you. If anyone learns your secret, they can use it to impersonate you.
#
# If you use this secret on more than one device you will create a fork and
# your friends will stop replicating your content.
#
{
  "curve": "ed25519",
  "public": "2RaC3mJIxjSzSuI82u8XA6OsoVlbOgPU3tayB10wFQ4=.ed25519",
  "private": "7CgCqrKvIYHFtXpkWHxvf4m5N9Vly4BKQmaoxCoOadbZFoLeYkjGNLNK4jza7xcDo6yhWVs6A9Te1rIHXTAVDg==.ed25519",
  "id": "@2RaC3mJIxjSzSuI82u8XA6OsoVlbOgPU3tayB10wFQ4=.ed25519"
}
#
# The only part of this file that's safe to share is your public name:
#
#   @2RaC3mJIxjSzSuI82u8XA6OsoVlbOgPU3tayB10wFQ4=.ed25519
staltz commented 4 years ago

Looks good to me now

christianbundy commented 4 years ago

Thanks!