You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bin/peppy.rs
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -35,17 +35,17 @@ struct GenerateSessionKeys {
35
35
structRandomPseudonym{}
36
36
37
37
#[derive(Command,Debug,Default)]
38
-
#[command("pseudonym-from-origin")]
39
-
#[description("Create a pseudonym from an existing identifier (16 bytes).")]
40
-
structPseudonymFromOrigin{
41
-
#[positional("origin",1,1)]
38
+
#[command("pseudonym-encode")]
39
+
#[description("Encode an identifier into a pseudonym (or long pseudonym if > 16 bytes).")]
40
+
structPseudonymEncode{
41
+
#[positional("identifier",1,1)]
42
42
args:Vec<String>,
43
43
}
44
44
45
45
#[derive(Command,Debug,Default)]
46
-
#[command("pseudonym-to-origin")]
47
-
#[description("Try to convert a pseudonym (or long pseudonym) back to its origin identifier.")]
48
-
structPseudonymToOrigin{
46
+
#[command("pseudonym-decode")]
47
+
#[description("Decode a pseudonym (or long pseudonym) back to its origin identifier.")]
48
+
structPseudonymDecode{
49
49
#[positional("pseudonym-hex...",1,100)]
50
50
args:Vec<String>,
51
51
}
@@ -137,8 +137,8 @@ enum Sub {
137
137
GenerateGlobalKeys(GenerateGlobalKeys),
138
138
GenerateSessionKeys(GenerateSessionKeys),
139
139
RandomPseudonym(RandomPseudonym),
140
-
PseudonymFromOrigin(PseudonymFromOrigin),
141
-
PseudonymToOrigin(PseudonymToOrigin),
140
+
PseudonymEncode(PseudonymEncode),
141
+
PseudonymDecode(PseudonymDecode),
142
142
Encrypt(Encrypt),
143
143
EncryptGlobal(EncryptGlobal),
144
144
Decrypt(Decrypt),
@@ -190,11 +190,11 @@ fn main() {
190
190
eprint!("Random pseudonym: ");
191
191
println!("{}",&pseudonym.encode_as_hex());
192
192
}
193
-
Some(Sub::PseudonymFromOrigin(arg)) => {
193
+
Some(Sub::PseudonymEncode(arg)) => {
194
194
let origin = arg.args[0].as_bytes();
195
195
match origin.len().cmp(&16){
196
196
Ordering::Greater => {
197
-
eprintln!("Warning: Origin identifier is longer than 16 bytes, using long pseudonym with PKCS#7 padding.");
197
+
eprintln!("Warning: Identifier is longer than 16 bytes, using long pseudonym with PKCS#7 padding. This comes with privacy risks, as blocks can highlight subgroups and the number of blocks is visible.");
198
198
let long_pseudonym = LongPseudonym::from_bytes_padded(origin)
0 commit comments