SlideShare a Scribd company logo
Protected Content
Rodrigo Панчиняк Fernandes
DRUPALCAMP KYIV 2019 – Kyiv, Ucrain
25/05/2019
Two places far away
Keyring generation
• User types in a password
• Password is concatenated with a hash used as a salt specific to
the user in the current enveiroment
• OpenPGPjs uses username, email address and random
numbers to create users public and private key
• Private key is symmetrically encrypted (aes256) with the salted
password
Password (and salt) are not submitted (proc/keyring/add)
Public key and aes256-encrypted private key are submitted via hidden fields.
Encryption of a file
• Recipient user needs to have registered encryption keys
• Sender user does not need to have registered encryption keys
(there is no signing)
• It is possible to encrypt the same file using multiple public
keys
• Mary can encrypt to herself as long as Mary has registered
keys
• Public keys of recipient users are loaded by their UIDs in a CSV
argument at /proc/add/<UIDs-CSV>
Text and binary files are treated the same way (binary Blob)
(/proc/new/<UIDs-CSV>)
Original file will never be submitted or leave the browser. When the user is able to press “Save”
the file has been encrypted with the public keys of the users identified by their UIDs.
Cipher text (ASCII Armored format) is ready to be submitted
File was read as a FileReader() object and converted to Uint8Array. A ReadableStream() is started with
it and composes together with recipient(s) pubkey(s) the “options” needed at
openpgp.encrypt(options)
Once the cipher text has been stored user gets its exclusive access link
Only the recipients will be allowed to access the link by Drupal permission and only the holder of the
decryption key will be able to decrypt the ciphertext. Metadata as filename and size are stored in the
database as plain text and are used to name and check the file created at the end of the decryption
process
Password must be typed in by the recipient user
Password is never submitted. If it fails an error message comes from OpenPGPjs library.
Wrong password
Wrong password fails to decrypt a cipher text.
Decryption (or fail on doing it) is triggered on “Get it” link
Decryption of a file
• Drupal checks if the current user is recipient of the ciphertext requested
• If this is the case, ciphertext is attached to the form at /proc/<pid>
• Ciphertext and encrypted privkey of the current user/recipient is
loaded in by js via Drupal.settings and becomes available for decryption
• First the privkey is decrypted in a promise
• Then the privkey composes together with the cipher text the “options”
needed at openpgp.decrypt(options)
• A new Blob (type octet-binary) object is created with the plaintext
• The size is checked against the database and if it matches, the link
becomes available according to the original file name.
Bonus 1: asymetric cyptography in a
metaphor
• The double locked box
• Alice wants to send a letter to Mary
• Alice puts the letter in a box. She locks it and only she has the key. Sehe
sends the box to Mary.
• Mary does not open it. Instead, Mary adds her own locker and sends the
now double locked box back to Alice.
• Alice removes her own locker and sends the box back to Mary.
• Mary opens the box removing her own locker
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 1. Alice picks two giant prime numbers, p and q. The primes
• should be enormous, but for simplicity we assume that Alice
• chooses p = 17, q = 11. She must keep these numbers secret.
• 2. Alice multiplies them together to get another number, N. In this case N
= 187. She now picks another number e, and in this case she chooses e = 7
(e and (p – 1) ✕ (q – 1) should be relatively prime, but this is a
technicality).
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 3. Alice can now publish e and N in something akin to a telephone
directory. Since these two numbers are necessary for encryption, they
must be available to anybody who might want to encrypt a message to
Alice. Together these numbers are called the public key. (As well as being
part of Alice’s public key, e could also be part of everybody else’s public
key. However, everybody must have a different value of N, which depends
on their choice of p and q.)
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 4. To encrypt a message, the message must first be converted into a
number, M. For example, a word is changed into ASCII binary digits, and
the binary digits can be considered as a decimal number. M is then
encrypted to give the ciphertext, C, according to the formula C = M e
(mod N ).
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 5. Imagine that Bob wants to send Alice a simple kiss: just the letter X. In
ASCII this is represented by 1011000, which is equivalent to 88 in decimal.
So, M = 88.
• 6. To encrypt this message, Bob looks up Alice’s public key, and discovers
that N = 187 and e = 7. This provides him with the encryption formula
required to encrypt messages to Alice. With M = 88, the formula gives C =
88 7 (mod 187).
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 7. Working this out directly on a calculator is tough, because the display
cannot cope with such large numbers. However, there is a trick for
calculating exponentials in modular arithmetic. We know that since 7 = 4
+ 2 + 1
Bob now sends the ciphertext, C =
11, to Alice.
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 8. We know that exponentials in modular arithmetic are one-way functions,
so it is very difficult to work backward from C = 11 and recover the original
message, M. Hence, Eve cannot decipher the message.
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 9. However, Alice can decipher the message because she has some special
information: she knows the values of p and q. She calculates a special
number, d, the decryption key,otherwise known as her private key. The
number d is calculated according to the following formula:
Bonus 2: rsa in 10 steps (by Simon Singh, The
Code Book)
• 10. To decrypt the message, Alice uses this formula:
Ad

More Related Content

Similar to PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL (20)

Security.ppt
Security.pptSecurity.ppt
Security.ppt
SherefHesham
 
Cryptography
CryptographyCryptography
Cryptography
Rutuja Solkar
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
SurendraBasnet6
 
Class3
Class3Class3
Class3
ankitasinghbsc
 
crypto Digital Signature Diffie Hell man.ppt
crypto Digital Signature Diffie Hell man.pptcrypto Digital Signature Diffie Hell man.ppt
crypto Digital Signature Diffie Hell man.ppt
SuryaBasnet3
 
CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem
Gyanmanjari Institute Of Technology
 
Fundamentals of Cryptography: Securing Data in the Digital Age
Fundamentals of Cryptography: Securing Data in the Digital AgeFundamentals of Cryptography: Securing Data in the Digital Age
Fundamentals of Cryptography: Securing Data in the Digital Age
avengersimran16
 
Crypto2
Crypto2Crypto2
Crypto2
phanleson
 
IEDA 3302 e-commerce_secure-communications.pptx
IEDA 3302 e-commerce_secure-communications.pptxIEDA 3302 e-commerce_secure-communications.pptx
IEDA 3302 e-commerce_secure-communications.pptx
ssuser6d0da2
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
VishwanathMahalle
 
Crypt
CryptCrypt
Crypt
Mir Majid
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
MIBrand
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
ShounakDas16
 
HifnCrypto101
HifnCrypto101HifnCrypto101
HifnCrypto101
Jim Faith
 
cryptography.pptcryptography.pptcryptography.ppt
cryptography.pptcryptography.pptcryptography.pptcryptography.pptcryptography.pptcryptography.ppt
cryptography.pptcryptography.pptcryptography.ppt
ssuserc7a853
 
cryptography.ppt by karthika kumar hirehegaalla
cryptography.ppt by karthika kumar hirehegaallacryptography.ppt by karthika kumar hirehegaalla
cryptography.ppt by karthika kumar hirehegaalla
hhjhona939
 
Digital Certified Mail
Digital Certified MailDigital Certified Mail
Digital Certified Mail
Matthew Chang
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2
Tutun Juhana
 
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Swati Nagpal
 
IS Unit 3_Public Key Cryptography
IS Unit 3_Public Key CryptographyIS Unit 3_Public Key Cryptography
IS Unit 3_Public Key Cryptography
Sarthak Patel
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
SurendraBasnet6
 
crypto Digital Signature Diffie Hell man.ppt
crypto Digital Signature Diffie Hell man.pptcrypto Digital Signature Diffie Hell man.ppt
crypto Digital Signature Diffie Hell man.ppt
SuryaBasnet3
 
Fundamentals of Cryptography: Securing Data in the Digital Age
Fundamentals of Cryptography: Securing Data in the Digital AgeFundamentals of Cryptography: Securing Data in the Digital Age
Fundamentals of Cryptography: Securing Data in the Digital Age
avengersimran16
 
IEDA 3302 e-commerce_secure-communications.pptx
IEDA 3302 e-commerce_secure-communications.pptxIEDA 3302 e-commerce_secure-communications.pptx
IEDA 3302 e-commerce_secure-communications.pptx
ssuser6d0da2
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
VishwanathMahalle
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
MIBrand
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
ShounakDas16
 
HifnCrypto101
HifnCrypto101HifnCrypto101
HifnCrypto101
Jim Faith
 
cryptography.pptcryptography.pptcryptography.ppt
cryptography.pptcryptography.pptcryptography.pptcryptography.pptcryptography.pptcryptography.ppt
cryptography.pptcryptography.pptcryptography.ppt
ssuserc7a853
 
cryptography.ppt by karthika kumar hirehegaalla
cryptography.ppt by karthika kumar hirehegaallacryptography.ppt by karthika kumar hirehegaalla
cryptography.ppt by karthika kumar hirehegaalla
hhjhona939
 
Digital Certified Mail
Digital Certified MailDigital Certified Mail
Digital Certified Mail
Matthew Chang
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2
Tutun Juhana
 
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Swati Nagpal
 
IS Unit 3_Public Key Cryptography
IS Unit 3_Public Key CryptographyIS Unit 3_Public Key Cryptography
IS Unit 3_Public Key Cryptography
Sarthak Patel
 

More from DrupalCamp Kyiv (20)

Speed up the site building with Drupal's Bootstrap Layout Builder
Speed up the site building with Drupal's Bootstrap Layout BuilderSpeed up the site building with Drupal's Bootstrap Layout Builder
Speed up the site building with Drupal's Bootstrap Layout Builder
DrupalCamp Kyiv
 
Performance Monitoring with Google Lighthouse
Performance Monitoring with Google LighthousePerformance Monitoring with Google Lighthouse
Performance Monitoring with Google Lighthouse
DrupalCamp Kyiv
 
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
DrupalCamp Kyiv
 
Acquia BLT for the Win, or How to speed up the project setup, development an...
Acquia BLT for the Win, or  How to speed up the project setup, development an...Acquia BLT for the Win, or  How to speed up the project setup, development an...
Acquia BLT for the Win, or How to speed up the project setup, development an...
DrupalCamp Kyiv
 
Upgrading to Drupal 9
Upgrading to Drupal 9Upgrading to Drupal 9
Upgrading to Drupal 9
DrupalCamp Kyiv
 
THE INTERNET OF THINGS IS GETTING REAL
THE INTERNET OF THINGS IS GETTING REALTHE INTERNET OF THINGS IS GETTING REAL
THE INTERNET OF THINGS IS GETTING REAL
DrupalCamp Kyiv
 
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLDFRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
DrupalCamp Kyiv
 
DRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCHDRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCH
DrupalCamp Kyiv
 
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
DrupalCamp Kyiv
 
Blackfire Workshop
Blackfire WorkshopBlackfire Workshop
Blackfire Workshop
DrupalCamp Kyiv
 
DRUPAL 8 STORAGES OVERVIEW
DRUPAL 8 STORAGES OVERVIEWDRUPAL 8 STORAGES OVERVIEW
DRUPAL 8 STORAGES OVERVIEW
DrupalCamp Kyiv
 
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICESONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
DrupalCamp Kyiv
 
1-1 MEETING: STEP-BY-STEP-HOW-TO
1-1 MEETING: STEP-BY-STEP-HOW-TO1-1 MEETING: STEP-BY-STEP-HOW-TO
1-1 MEETING: STEP-BY-STEP-HOW-TO
DrupalCamp Kyiv
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATION
DrupalCamp Kyiv
 
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
DrupalCamp Kyiv
 
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERATECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
DrupalCamp Kyiv
 
DRUPAL AUDITS MADE FASTR
DRUPAL AUDITS MADE FASTRDRUPAL AUDITS MADE FASTR
DRUPAL AUDITS MADE FASTR
DrupalCamp Kyiv
 
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
DrupalCamp Kyiv
 
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONSSEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
DrupalCamp Kyiv
 
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCEDEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
DrupalCamp Kyiv
 
Speed up the site building with Drupal's Bootstrap Layout Builder
Speed up the site building with Drupal's Bootstrap Layout BuilderSpeed up the site building with Drupal's Bootstrap Layout Builder
Speed up the site building with Drupal's Bootstrap Layout Builder
DrupalCamp Kyiv
 
Performance Monitoring with Google Lighthouse
Performance Monitoring with Google LighthousePerformance Monitoring with Google Lighthouse
Performance Monitoring with Google Lighthouse
DrupalCamp Kyiv
 
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
DrupalCamp Kyiv
 
Acquia BLT for the Win, or How to speed up the project setup, development an...
Acquia BLT for the Win, or  How to speed up the project setup, development an...Acquia BLT for the Win, or  How to speed up the project setup, development an...
Acquia BLT for the Win, or How to speed up the project setup, development an...
DrupalCamp Kyiv
 
THE INTERNET OF THINGS IS GETTING REAL
THE INTERNET OF THINGS IS GETTING REALTHE INTERNET OF THINGS IS GETTING REAL
THE INTERNET OF THINGS IS GETTING REAL
DrupalCamp Kyiv
 
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLDFRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
DrupalCamp Kyiv
 
DRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCHDRUPAL AND ELASTICSEARCH
DRUPAL AND ELASTICSEARCH
DrupalCamp Kyiv
 
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
DrupalCamp Kyiv
 
DRUPAL 8 STORAGES OVERVIEW
DRUPAL 8 STORAGES OVERVIEWDRUPAL 8 STORAGES OVERVIEW
DRUPAL 8 STORAGES OVERVIEW
DrupalCamp Kyiv
 
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICESONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
DrupalCamp Kyiv
 
1-1 MEETING: STEP-BY-STEP-HOW-TO
1-1 MEETING: STEP-BY-STEP-HOW-TO1-1 MEETING: STEP-BY-STEP-HOW-TO
1-1 MEETING: STEP-BY-STEP-HOW-TO
DrupalCamp Kyiv
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATION
DrupalCamp Kyiv
 
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
DrupalCamp Kyiv
 
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERATECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
DrupalCamp Kyiv
 
DRUPAL AUDITS MADE FASTR
DRUPAL AUDITS MADE FASTRDRUPAL AUDITS MADE FASTR
DRUPAL AUDITS MADE FASTR
DrupalCamp Kyiv
 
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
DrupalCamp Kyiv
 
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONSSEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
DrupalCamp Kyiv
 
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCEDEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
DrupalCamp Kyiv
 
Ad

Recently uploaded (20)

How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
Ad

PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL

  • 1. Protected Content Rodrigo Панчиняк Fernandes DRUPALCAMP KYIV 2019 – Kyiv, Ucrain 25/05/2019
  • 3. Keyring generation • User types in a password • Password is concatenated with a hash used as a salt specific to the user in the current enveiroment • OpenPGPjs uses username, email address and random numbers to create users public and private key • Private key is symmetrically encrypted (aes256) with the salted password
  • 4. Password (and salt) are not submitted (proc/keyring/add) Public key and aes256-encrypted private key are submitted via hidden fields.
  • 5. Encryption of a file • Recipient user needs to have registered encryption keys • Sender user does not need to have registered encryption keys (there is no signing) • It is possible to encrypt the same file using multiple public keys • Mary can encrypt to herself as long as Mary has registered keys • Public keys of recipient users are loaded by their UIDs in a CSV argument at /proc/add/<UIDs-CSV>
  • 6. Text and binary files are treated the same way (binary Blob) (/proc/new/<UIDs-CSV>) Original file will never be submitted or leave the browser. When the user is able to press “Save” the file has been encrypted with the public keys of the users identified by their UIDs.
  • 7. Cipher text (ASCII Armored format) is ready to be submitted File was read as a FileReader() object and converted to Uint8Array. A ReadableStream() is started with it and composes together with recipient(s) pubkey(s) the “options” needed at openpgp.encrypt(options)
  • 8. Once the cipher text has been stored user gets its exclusive access link Only the recipients will be allowed to access the link by Drupal permission and only the holder of the decryption key will be able to decrypt the ciphertext. Metadata as filename and size are stored in the database as plain text and are used to name and check the file created at the end of the decryption process
  • 9. Password must be typed in by the recipient user Password is never submitted. If it fails an error message comes from OpenPGPjs library.
  • 10. Wrong password Wrong password fails to decrypt a cipher text. Decryption (or fail on doing it) is triggered on “Get it” link
  • 11. Decryption of a file • Drupal checks if the current user is recipient of the ciphertext requested • If this is the case, ciphertext is attached to the form at /proc/<pid> • Ciphertext and encrypted privkey of the current user/recipient is loaded in by js via Drupal.settings and becomes available for decryption • First the privkey is decrypted in a promise • Then the privkey composes together with the cipher text the “options” needed at openpgp.decrypt(options) • A new Blob (type octet-binary) object is created with the plaintext • The size is checked against the database and if it matches, the link becomes available according to the original file name.
  • 12. Bonus 1: asymetric cyptography in a metaphor • The double locked box • Alice wants to send a letter to Mary • Alice puts the letter in a box. She locks it and only she has the key. Sehe sends the box to Mary. • Mary does not open it. Instead, Mary adds her own locker and sends the now double locked box back to Alice. • Alice removes her own locker and sends the box back to Mary. • Mary opens the box removing her own locker
  • 13. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 1. Alice picks two giant prime numbers, p and q. The primes • should be enormous, but for simplicity we assume that Alice • chooses p = 17, q = 11. She must keep these numbers secret. • 2. Alice multiplies them together to get another number, N. In this case N = 187. She now picks another number e, and in this case she chooses e = 7 (e and (p – 1) ✕ (q – 1) should be relatively prime, but this is a technicality).
  • 14. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 3. Alice can now publish e and N in something akin to a telephone directory. Since these two numbers are necessary for encryption, they must be available to anybody who might want to encrypt a message to Alice. Together these numbers are called the public key. (As well as being part of Alice’s public key, e could also be part of everybody else’s public key. However, everybody must have a different value of N, which depends on their choice of p and q.)
  • 15. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 4. To encrypt a message, the message must first be converted into a number, M. For example, a word is changed into ASCII binary digits, and the binary digits can be considered as a decimal number. M is then encrypted to give the ciphertext, C, according to the formula C = M e (mod N ).
  • 16. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 5. Imagine that Bob wants to send Alice a simple kiss: just the letter X. In ASCII this is represented by 1011000, which is equivalent to 88 in decimal. So, M = 88. • 6. To encrypt this message, Bob looks up Alice’s public key, and discovers that N = 187 and e = 7. This provides him with the encryption formula required to encrypt messages to Alice. With M = 88, the formula gives C = 88 7 (mod 187).
  • 17. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 7. Working this out directly on a calculator is tough, because the display cannot cope with such large numbers. However, there is a trick for calculating exponentials in modular arithmetic. We know that since 7 = 4 + 2 + 1 Bob now sends the ciphertext, C = 11, to Alice.
  • 18. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 8. We know that exponentials in modular arithmetic are one-way functions, so it is very difficult to work backward from C = 11 and recover the original message, M. Hence, Eve cannot decipher the message.
  • 19. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 9. However, Alice can decipher the message because she has some special information: she knows the values of p and q. She calculates a special number, d, the decryption key,otherwise known as her private key. The number d is calculated according to the following formula:
  • 20. Bonus 2: rsa in 10 steps (by Simon Singh, The Code Book) • 10. To decrypt the message, Alice uses this formula:
  翻译: