Django-sem,how to make SignedEmailMessageout of EmailMessage in few simple             steps.           Jakub Wasielak, 2012
Identity verification  Why?● Easier bureaucracy●   Fraud prevention●   Enabling law●   Interpersonal communication
Identity verification  How?● Ancient timesMostly verbal verification
Identity verification  How?● Ancient times      Mostly verbal verification●   Middle Ages    Sealing wax
Identity verification  How?● Ancient times       Mostly verbal verification●   Middle Ages        Sealing wax●   Before in...
Identity verification  How?● Ancient times       Mostly verbal verification●   Middle Ages        Sealing wax●   Before in...
Public-key infrastructureCreating, managing, using, storing, andrevoking Digital Certificates.
Public-key infrastructureAll the stuff connected with           Digital Certificates.
Public-key infrastructureAll the stuff connected with           Digital Certificates.CA – Certificate Authority – the unit...
Digital Certificate    X.509 (PKI)●   Signature Algorithm – selected by CA●   Issuer – CA itself●   Subject – your data●  ...
Digital CertificateCertificate: Data:    Version: 1 (0x0)    Serial Number: 7829 (0x1e95)    Signature Algorithm: md5WithR...
Signed mail in          Thunderbird
Signed mail in             Outlook
Signed mail in       some apple client
Signed mail in              Gmail     ?
Signing – first stepsMeTooCrypto:M2Crypto is the most complete Pythonwrapper for OpenSSL featuring RSA, DSA,DH, HMACs, mes...
Signing – first stepsMeTooCrypto:M2Crypto is not well documented.
SignedEmailMessage – a week later 1. Add SEM into INSTALLED_APPS. 2. Add DEFAULT_CHARSET and AUTH_CERT into setting. 3. Us...
1. Add SEM into INSTALLED_APPS. pip install django-sem   INSTALLED_APPS = (       ...       SEM,       ...       )
2. Add DEFAULT_CHARSET andAUTH_CERT into setting. DEFAULT_CHARSET = utf-8 AUTH_CERT = "resources/cert.pem"/resources/cert....
3. Use it. Normal EmailMessage usage from django.core.mail import EmailMessage msg = EmailMessage(             subject, me...
Upcoming SlideShare
Loading in …5
×

Django SEM

5,531 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
5,531
On SlideShare
0
From Embeds
0
Number of Embeds
4,729
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Django SEM

  1. 1. Django-sem,how to make SignedEmailMessageout of EmailMessage in few simple steps. Jakub Wasielak, 2012
  2. 2. Identity verification Why?● Easier bureaucracy● Fraud prevention● Enabling law● Interpersonal communication
  3. 3. Identity verification How?● Ancient timesMostly verbal verification
  4. 4. Identity verification How?● Ancient times Mostly verbal verification● Middle Ages Sealing wax
  5. 5. Identity verification How?● Ancient times Mostly verbal verification● Middle Ages Sealing wax● Before internet Stamps
  6. 6. Identity verification How?● Ancient times Mostly verbal verification● Middle Ages Sealing wax● Before internet Stamps● Now S/MIME
  7. 7. Public-key infrastructureCreating, managing, using, storing, andrevoking Digital Certificates.
  8. 8. Public-key infrastructureAll the stuff connected with Digital Certificates.
  9. 9. Public-key infrastructureAll the stuff connected with Digital Certificates.CA – Certificate Authority – the unit capableof issuing and verifying the digitalcertificates.
  10. 10. Digital Certificate X.509 (PKI)● Signature Algorithm – selected by CA● Issuer – CA itself● Subject – your data● Subject Public Key – your public key● Certificate signature – the actual signature● Version, Serial Number, Validity
  11. 11. Digital CertificateCertificate: Data: Version: 1 (0x0) Serial Number: 7829 (0x1e95) Signature Algorithm: md5WithRSAEncryption Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=Certification Services Division, CN=Thawte Server CA/emailAddress=server-certs@thawte.com Validity Not Before: Jul 9 16:04:02 1998 GMT Not After : Jul 9 16:04:02 1999 GMT Subject: C=US, ST=Maryland, L=Pasadena, O=Brent Baccala, OU=FreeSoft, CN=www.freesoft.org/emailAddress=baccala@freesoft.org Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:b4:31:98:0a:c4:bc:62:c1:88:aa:dc:b0:c8:bb: ... e8:35:1c:9e:27:52:7e:41:8f Exponent: 65537 (0x10001) Signature Algorithm: md5WithRSAEncryption 93:5f:8f:5f:c5:af:bf:0a:ab:a5:6d:fb:24:5f:b6:59:5d:9d: ... 8f:0e:fc:ba:1f:34:e9:96:6e:6c:cf:f2:ef:9b:bf:de:b5:22
  12. 12. Signed mail in Thunderbird
  13. 13. Signed mail in Outlook
  14. 14. Signed mail in some apple client
  15. 15. Signed mail in Gmail ?
  16. 16. Signing – first stepsMeTooCrypto:M2Crypto is the most complete Pythonwrapper for OpenSSL featuring RSA, DSA,DH, HMACs, message digests, symmetricciphers, SSL functionality, HTTPS, urllib,xmlrpclib, HMACing AuthCookies,FTP/TLS, S/MIME, ZserverSSL andZSmime.
  17. 17. Signing – first stepsMeTooCrypto:M2Crypto is not well documented.
  18. 18. SignedEmailMessage – a week later 1. Add SEM into INSTALLED_APPS. 2. Add DEFAULT_CHARSET and AUTH_CERT into setting. 3. Use it.
  19. 19. 1. Add SEM into INSTALLED_APPS. pip install django-sem INSTALLED_APPS = ( ... SEM, ... )
  20. 20. 2. Add DEFAULT_CHARSET andAUTH_CERT into setting. DEFAULT_CHARSET = utf-8 AUTH_CERT = "resources/cert.pem"/resources/cert.pem -----BEGIN CERTIFICATE----- AGSJGAS34BDS4htg0234gADSG923ng92G3h2tgjs9afgf ... ... j892th39gSAHGy329hggeZHDg89hegZGDSHY0== -----END CERTIFICATE-----The CA certificate. Available at CA site.
  21. 21. 3. Use it. Normal EmailMessage usage from django.core.mail import EmailMessage msg = EmailMessage( subject, message_body, sender, recipient_list, attachments=attachments) msg.send()SignedEmailMessage usage from SEM import SEMail msg = SEMail.SignedEmailMessage( subject, message_body, sender, recipient_list, attachments=attachments, from_key=from_key, from_cert=from_cert) msg.send()

×