PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... ·...

19
PGP Messaging Ellip%c Curve PGP Implementa%on for SMS Final Presenta%on

Transcript of PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... ·...

Page 1: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

PGP  Messaging Ellip%c  Curve  PGP  Implementa%on  for  SMS  

Final  Presenta%on  

Page 2: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Short  Message  Service  (SMS)

Musbikhin.    (2012,  June).    Short  Message  Service  (SMS)  [Online].    Available:  hKp://www.musbikhin.com/short-­‐message-­‐service-­‐sms    

HP:  Mobile  Devices    BTS:  Base  transceiver  sta%on    BSC:  Base  sta%on  controller    MSC:  Mobile  switching  center    SMSC:  Short  message  service  center  

Page 3: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Exis7ng  SMS  Encryp7on  Applica7ons  for  Android •  Symmetric  

•  SMS  Encryp%on  Droid  •  TxT  Encrypt  

 Drawbacks:  •  Suffer  from  key  distribu%on  problem  

•  No  non-­‐repudia%on  

• Asymmetric  •  TextSecure  •  PGP  SMS  •  ECC  SMS  

Drawbacks  •  Mul%ple  SMS  messages  to  send  single  message  •  No  implementa%on  of  ring  of  trust  •  No  non-­‐repudia%on  •  Require  centralized  server  

Page 4: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

PGP  Messaging • Public  key  cryptosystem  based  on  Ellip%c  Curve  Cryptography  • Message  

•  Key  generated  using  private  key  and  recipient  public  key  in  an  ellip%c  curve  key  deriva%on  func%on  (KDF)  

•  Resul%ng  key  used  for  AES-­‐256  encryp%on  •  Signature  

•  Messages  and  Public  Keys  signed  using  SHA-­‐256  and  ECDSA  

• Private  keys  -­‐  encrypted  using  AES-­‐256  • PreKy  Good  Privacy  Key  Rings  

Page 5: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Cryptographic  Libraries •  Spongy  Castle  

•  Open  source  lightweight  implementa%on  of  Bouncy  Castle  specifically  for  Android  

•  Downloadable  at  hKp://rtyley.github.io/spongycastle/  •  Provides  

•  AES  Encryp%on/Decryp%on  •  Ellip%c  Curve  Key  Genera%on  (prime192v1)  •  Key  Deriva%on  Func%on  (ECDH)  •  Ellip%c  Curve  Digital  Signature  Algorithm  (SHA256withECDSA)  

• Android  SDK  •  SHA-­‐256  

Page 6: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Choose  from  available  public  keys  •  Displays  phone  number  and  key  ID  

•  Choose  from  available  private  keys  •  Displays  phone  number  and  key  ID  

•  Password  field  for  decryp%ng  private  key  

•  Entered  plaintext  message  to  be  transmiKed  

Message  Sender

Page 7: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Implementa7on  (Sending)

Private    Key  ID  

Public  Key  ID  

KDF  

||   ||   ||  

Header  

Output  Base64  Encoding  

Private  Key  |  Key  ID  

Public  Key  |  Key  ID   Select  

Select  D  Password   H  

Private-­‐Key  Ring  

Public-­‐Key  Ring  

Message  (M)  

H   ||   E  SGNGen  

H   SHA-­‐256  

E   AES-­‐256  encryp%on  

D   AES-­‐256  decryp%on  

||   Concatenate  

KDF   Key  Deriva%on  Func%on  

SGN   Signature  Crea%on  

Page 8: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Header   PGPM:   Unencrypted  

Recipient  Key  ID   8  bytes   Unencrypted  

Sender  Key  ID   8  bytes   Unencrypted  

Signature  Length   1  byte   Encrypted  with    AES-­‐256  Signature   56  bytes  

Message   39  bytes  

•  160  total  bytes  available  (SMS  Standard)  

•  5  characters  for  header  •  155  remaining  becomes  113  

characters  (because  of  Base64  encoding)  

•  Header  alerts  applica%on  that  following  data  is  encrypted  and  contains  signature  

•  Header  and  key  IDs  are  not  encrypted  

Message  Format

Page 9: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Implementa7on  (Receiving) H   SHA-­‐256  

E   AES-­‐256  encryp%on  

D   AES-­‐256  decryp%on  

||   Concatenate  

KDF   Key  Deriva%on  Func%on  

SGN   Signature  Verifica%on  

Encrypted  Message  

KDF  

Base64  Encoding  

Key  ID  |  Private  Key  

Key  ID|  Public  Key  

D   Password  H  

Private-­‐Key  Ring  

Public-­‐Key  Ring  

Sender  Key  ID  

Recipient  Key  ID  

Header  

D  Signature  

Message   H  Comparison  

SGNVer  

Page 10: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  All  messages  in  SMS  database  displayed  •  Messages  remain  encrypted  

•  Full  encrypted  SMS  displayed  •  Header  has  been  removed  

Message  Reader Encrypted

Page 11: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Password  entered  •  Pressing  Decrypt  buKon  performs:  

•  Base64  Decoding  •  Decryp%on  •  Signature  Verifica%on  

•  Public  Key  Trust  Indicator  •  Complete  trust  in  public  key  used:  

 •  Marginal  trust  in  public  key  used:  

 •  No  trust  (or  undefined  trust)  

in  public  key  used:      

Message  Reader Decrypted

Page 12: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Displays  the  following  informa%on  •  User  ID  –  11  digit  phone  number  •  Key  ID  –  last  64  bits  of  public  key  •  Date  added  to  public  key  ring  •  Public  Key  values  •  Owner  trust  field  •  Public  key  trust  •  Number  of  associated  signatures  

Public-­‐Key  Ring

Page 13: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Available  Fields  •  Ul%mate  Trust  •  Complete  Trust  •  Marginal  Trust  •  Not  Trusted  •  Unknown  User  •  Undefined  User  

•  Assigned  trust  level  also  applies  to  all  signatures  in  database  

Public-­‐Key  Ring  Owner  Trust

Page 14: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  User  can  sign  any  public  key  in  the  Public-­‐Key  Ring  

•  Select  private  key  to  sign  with  •  Password  needed  for  decryp%ng  private  

key  

Signature  Genera7on

Page 15: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Any  public  key  and  accompanying  signatures  may  be  sent  to  another  user  

•  Public  key  and  all  signatures  are  sent  •  1  SMS  per  signature  +  1  SMS  for  

Public  Key  

Signature  Transmission

Page 16: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Public-­‐Key  Ring  Public  Key  Trust

•  For  any  given  public  key:  •  Has  associated  signatures  •  Each  signature  has  a  user  

configurable  level  of  trust  assigned  to  it  (owner  trust)  

•  Trust  in  a  public  key  is  derived  from  the  owner  trust  assigned  to  the  associated  signatures  

Public  Key  Trust=1/𝑋 ∗𝑛↓𝑡𝑟𝑢𝑠𝑡𝑒𝑑 + 1/𝑌 ∗n↓usually  trusted   

Public  Key  Trust≥1:  

𝑋=𝑈𝑠𝑒𝑟  𝐷𝑒𝑓𝑖𝑛𝑒𝑑  𝑊𝑒𝑖𝑔ℎ𝑡≥1  𝑌=𝑈𝑠𝑒𝑟  𝐷𝑒𝑓𝑖𝑛𝑒𝑑  𝑊𝑒𝑖𝑔ℎ𝑡≥1  

Public  Key  Trust  >0:  

Public  Key  Trust=0:  

Complete  trust  

Marginal  trust  

No  trust  

Page 17: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

Public-­‐Key  Ring   Public  Key  Trust  -­‐  Example

•  Public  Key  0x23711341d5478f79  has  three  associated  signatures  

•  Signature  1  •  Created  by  user  with  Owner  Trust  =  

Complete  Trust  

•  Signature  2  •  Created  by  user  with  Owner  Trust  =  

Marginal  Trust  

•  Signature  3  •  Created  by  user  with  Owner  Trust  =  

Marginal  Trust  

Public  Key  Trust=1/2 ∗1+1/3 ∗2=1.167  

Public  Key  Trust≥1:  

𝑋=2  𝑌=3  

Complete  trust  

Page 18: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Displays  the  following  informa%on  •  User  ID  –  11  digit  phone  number  •  Key  ID  –  last  128  bits  of  public  key  •  Date  of  genera%on  •  Public  Key  values  

•  Does  not  display  •  Encrypted  private  key  

•  Different  private  keys  may  be  encrypted  with  different  passwords  

Private  Key  Ring

Page 19: PGPMessaging - George Mason Universityece.gmu.edu/coursewebpages/ECE/ECE646/F17/project/F13... · Header’ PGPM:’ Unencrypted’ RecipientKey’ID’ 8’bytes’ Unencrypted’

•  Android  Applica%on  Developed  •  Provides  confiden%ality  and  non-­‐repudia%on  •  Implements  web  of  trust  •  Does  not  require  centralized  servers  

•  Confiden%ality  with  overhead  •  37  effec%ve  characters  per  SMS  •  Security  func%ons  impose  75%  overhead  

Summary  and  Conclusions