SlideShare a Scribd company logo
1 of 29
Download to read offline
Apache Commons Crypto:
Another wheel of Apache Commons
Dapeng Sun/ Xianda Ke
About us
Dapeng Sun @Intel
• Apache Commons Committer
• Apache Sentry PMC
Xianda Ke @Intel
• Apache Commons Crypto
• Apache Pig(Pig on Spark)
• OpenJDK
Agenda
• Brief introduction to cryptography
• What’s Commons Crypto?
• Why did we create another wheel?
• Performance secrets
• Securing big data & API samples
A glance at cryptographic primitives
• Symmetric encryption(Secret Key) : Confidentiality
DES/3DES, RC4, AES, …
• Asymmetric encryption (Public Key)
Authentication / Key exchange : RSA, Diffie-Hellman, ECC, ...
• Hash algorithms: Integrity
MD5 , SHA-1, SHA-2, GMAC(a variant of the GCM), …
• Authenticated Encryption(AE): Confidentiality + Integrity
RC4 + HmacMD5, RC4 + HMAC-SHA-1, AES-GCM, …
• Random Number Generator
PRNG(Pseudo) / TRNG(True)
• mode of operation: blurs the cipher output
What is Commons Crypto?(1)
• High-performance Java cryptography library optimized with
AES-NI
• It wraps OpenSSL as the engine(via JNI)
History of Commons Crypto(1)
• HDFS Crypto codec
• Intel AES-NI
• Native library(OpenSSL) support
• 17x performance improvement
History of Commons Crypto(2)
• Promote the advancement to other projects
• Intel’s big data team created Chimera library
• https://github.com/intel-hadoop/Chimera
• Easily contribute towards the advancement of AES-NI
History of Commons Crypto(3)
•Worked with Commons community contribute to
Apache Community
• https://commons.apache.org/proper/commons-crypto/
What is Commons Crypto? (2)
• Low level Cipher API
Only support AES algorithm now
• Stream API
To encrypt Stream/Channel
• Random API
True Random Number Generator
JCE(Java Cryptography Extension) in hand, why did we create
another wheel?
background & motivation
Don’t end up in a bottleneck…
Some Java cryptographic protocols(e.g. SASL) are using
inefficient or weak low-level algorithms:
3DES, RC4, …
Hadoop/Spark users own very ‘big’ data…
• User’s data is vulnerable to attack
• Performance of JCE is the bottleneck!
Take security & performance into account,
JCE is impractical
Choosing algorithm for data encryption
DES is broken 3DES is too slow
RC4 is ‘fast’, but weak. AES is secure
prohibited by RFC 7465
However, the problem is that
AES’s performance in JDK is NOT good enough…
* CPU: Xeon(R) CPU E5-2690 v2 @ 3.00GHz. Memory: DDR3-1600, 64 G.
14.59
228.98 297.54
1196.01
0
200
400
600
800
1000
1200
1400
3DES(JDK8) AES-CTR-128(JDK8) RC4(JDK8) AES-CTR-128(Crypto)
THROUGHPUT OF SYMMETRIC ALGORITHMS (MB/S)
149.8 131.69
3.98
267.78
762.81
0
100
200
300
400
500
600
700
800
900
RC4+HmacMD5(JDK8) RC4+HmacSHA1(JDK8) AES-GCM(JDK8) AES-GCM(JDK9) AES-GCM(Crypto)
THROUGHPUT OF AES ALGORITHMS (MB/S)
* CPU: Xeon(R) CPU E5-2690 v2 @ 3.00GHz. Memory: DDR3-1600, 64 G.
~190X
~ 6X
6.61
86.83
0
10
20
30
40
50
60
70
80
90
100
SecureRandom(JDK8) CrytpoRandom
THROUGHPUT OF RANDOM NUMBER
GENERATOR (MB/S)
*Java 8. CPU: Xeon(R) CPU E5-2690 v2 @ 3.00GHz. Memory: DDR3, 64 G.
~13X
Commons Crypto is a better alternative!
SECURE FAST
Using Commons Crypto to secure your big
data, and no performance bottleneck
You might ask what makes crypto so fast?
AES algorithm: each round consists of several processing steps:
MixColumn, ShiftRow, Substitute bytes
All these steps in a round can be done by a SINGLE instruction
Performance Secret (1): AES in hardware (Intel®AES-NI)
AESENC xmm1, xmm2
Performance Secret (2): Pipelining(instruction-level parallelism)
AESENC instruction takes 7 CPU clock cycles
data dependence exists, instructions have to be
executed one by one
Pipelining instructions,
6 instructions take only
12 clock cycles
Other performance Secrets:
 Well-optimized assembly code in OpenSSL
• Better SSE/AVX registers usage (x86 platform)
• Data locality, etc…
 Hardware acceleration in OpenSSL
• Intel® Carry-Less Multiplication Instruction (PCLMULQDQ for GCM)
• Intel® Secure Key (RDRAND, Random Number Generator)
• in other architectures
 HotSpot Intrinsics for AES are NOT well-optimized (JDK 8)
JDK 9 is becoming fast…
• JDK-8073108 enables PCLMULQDQ for AES-GCM,
~60X gain, still falls far behind Commons Crypto
We’ve contributed two patches to OpenJDK (HotSpot):
• JDK-8143925 x86 AES-CTR, 5~8x gain
• JDK-8152354 x86 AES-CBC Decryption, 15%~50% gain
But we have to wait for a few years to adopt
Java 9 in our software production… 
Big Data components are using Commons Crypto/AES-NI
• AES support for over-the-wire encryption(SPARK-13331)
• Add encrypted shuffle in spark (SPARK-5682)
• brings 12.5% overall performance gain
• Optimize HDFS Encrypted Transport performance (HDFS-6606)
• brings 17x overall performance gain
• Improve transparent table/CF encryption with Commons Crypto (HBASE-16463)
• showed 4% to 42% gain for HFile encryption using HfilePerformanceEvaluation tool
• Improve performance for RPC encryption (HBASE-16414)
• improves performance about 9x when enable delegation token
(in development) :
Optimize Hadoop RPC encryption performance(HADOOP-10768)
Replace Hadoop Common crypto code with Apache Commons Crypto(HADOOP-13635)
API & Samples
API & Samples
API & Samples
Status & Future work:
Status:
• v1.0.0 is released. AES-CBC, AES-CTR are supported
• AES-GCM ( will be released in next release)
Future work : to cover more facets :
• Support Asymmetric key algorithms: RSA, DSA
• …
How to contribute:
• SCM: https://github.com/apache/commons-crypto
• Apache Bugtracker (JIRA): https://issues.apache.org/jira/
Thank You
Q & A
ApacheCon: Apache Commons Crypto 2017

More Related Content

What's hot

Make 2016 your year of SMACK talk
Make 2016 your year of SMACK talkMake 2016 your year of SMACK talk
Make 2016 your year of SMACK talkDataStax Academy
 
Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0DataStax
 
Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
 Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C... Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...Databricks
 
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...Spark Summit
 
Traveler's Guide to Cassandra
Traveler's Guide to CassandraTraveler's Guide to Cassandra
Traveler's Guide to CassandraDataStax Academy
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture PerformanceEnkitec
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Bobby Curtis
 
Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...
Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...
Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...Spark Summit
 
Using Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
Using Apache Spark in the Cloud—A Devops Perspective with Telmo OliveiraUsing Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
Using Apache Spark in the Cloud—A Devops Perspective with Telmo OliveiraSpark Summit
 
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...Spark Summit
 
Apache Spark: Lightning Fast Cluster Computing
Apache Spark: Lightning Fast Cluster ComputingApache Spark: Lightning Fast Cluster Computing
Apache Spark: Lightning Fast Cluster ComputingAll Things Open
 
Hit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate MicroservicesHit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate MicroservicesBobby Curtis
 
Apache Spark Operations
Apache Spark OperationsApache Spark Operations
Apache Spark OperationsCloudera, Inc.
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to RestStratoscale
 
APACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van Niekerk
APACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van NiekerkAPACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van Niekerk
APACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van NiekerkSpark Summit
 
Bringing complex event processing to Spark streaming
Bringing complex event processing to Spark streamingBringing complex event processing to Spark streaming
Bringing complex event processing to Spark streamingDataWorks Summit
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationBobby Curtis
 
Reactive app using actor model & apache spark
Reactive app using actor model & apache sparkReactive app using actor model & apache spark
Reactive app using actor model & apache sparkRahul Kumar
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSpark Summit
 

What's hot (20)

Make 2016 your year of SMACK talk
Make 2016 your year of SMACK talkMake 2016 your year of SMACK talk
Make 2016 your year of SMACK talk
 
Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0
 
Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
 Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C... Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
 
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
 
Traveler's Guide to Cassandra
Traveler's Guide to CassandraTraveler's Guide to Cassandra
Traveler's Guide to Cassandra
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)
 
Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...
Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...
Fault Tolerance in Spark: Lessons Learned from Production: Spark Summit East ...
 
Using Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
Using Apache Spark in the Cloud—A Devops Perspective with Telmo OliveiraUsing Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
Using Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
 
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
 
Apache Spark: Lightning Fast Cluster Computing
Apache Spark: Lightning Fast Cluster ComputingApache Spark: Lightning Fast Cluster Computing
Apache Spark: Lightning Fast Cluster Computing
 
Hit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate MicroservicesHit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate Microservices
 
Apache Spark Operations
Apache Spark OperationsApache Spark Operations
Apache Spark Operations
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to Rest
 
Effective Spark on Multi-Tenant Clusters
Effective Spark on Multi-Tenant ClustersEffective Spark on Multi-Tenant Clusters
Effective Spark on Multi-Tenant Clusters
 
APACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van Niekerk
APACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van NiekerkAPACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van Niekerk
APACHE TOREE: A JUPYTER KERNEL FOR SPARK by Marius van Niekerk
 
Bringing complex event processing to Spark streaming
Bringing complex event processing to Spark streamingBringing complex event processing to Spark streaming
Bringing complex event processing to Spark streaming
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
 
Reactive app using actor model & apache spark
Reactive app using actor model & apache sparkReactive app using actor model & apache spark
Reactive app using actor model & apache spark
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
 

Similar to ApacheCon: Apache Commons Crypto 2017

Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
 Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
Efficient Spark Analytics on Encrypted Data with Gidon GershinskyDatabricks
 
Tackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-Premise
Tackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-PremiseTackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-Premise
Tackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-PremiseDatabricks
 
In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...
In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...
In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...Tom Diederich
 
High performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User GroupHigh performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User GroupHungWei Chiu
 
Sparc m6 32 in-memory infrastructure for the entire enterprise
Sparc m6 32 in-memory infrastructure for the entire enterpriseSparc m6 32 in-memory infrastructure for the entire enterprise
Sparc m6 32 in-memory infrastructure for the entire enterprisesolarisyougood
 
Introduction to FPGA acceleration
Introduction to FPGA accelerationIntroduction to FPGA acceleration
Introduction to FPGA accelerationMarco77328
 
Share winter 2016 encryption
Share winter 2016 encryptionShare winter 2016 encryption
Share winter 2016 encryptionbigendiansmalls
 
ODSA Use Case - SmartNIC
ODSA Use Case - SmartNICODSA Use Case - SmartNIC
ODSA Use Case - SmartNICODSA Workgroup
 
6 open capi_meetup_in_japan_final
6 open capi_meetup_in_japan_final6 open capi_meetup_in_japan_final
6 open capi_meetup_in_japan_finalYutaka Kawai
 
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)Ontico
 
Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...
Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...
Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...Ramesh Nagappan
 
Data Pipelines and Telephony Fraud Detection Using Machine Learning
Data Pipelines and Telephony Fraud Detection Using Machine Learning Data Pipelines and Telephony Fraud Detection Using Machine Learning
Data Pipelines and Telephony Fraud Detection Using Machine Learning Eugene
 
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...Databricks
 
SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4UniFabric
 
Servers Technologies and Enterprise Data Center Trends 2014 - Thailand
Servers Technologies and Enterprise Data Center Trends 2014 - ThailandServers Technologies and Enterprise Data Center Trends 2014 - Thailand
Servers Technologies and Enterprise Data Center Trends 2014 - ThailandAruj Thirawat
 
Supermicro X12 Performance Update
Supermicro X12 Performance UpdateSupermicro X12 Performance Update
Supermicro X12 Performance UpdateRebekah Rodriguez
 

Similar to ApacheCon: Apache Commons Crypto 2017 (20)

Oracle SPARC T7 a M7 servery
Oracle SPARC T7 a M7 serveryOracle SPARC T7 a M7 servery
Oracle SPARC T7 a M7 servery
 
Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
 Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
 
Tackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-Premise
Tackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-PremiseTackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-Premise
Tackling Network Bottlenecks with Hardware Accelerations: Cloud vs. On-Premise
 
Fixed-point Multi-Core DSP Platform
Fixed-point Multi-Core DSP PlatformFixed-point Multi-Core DSP Platform
Fixed-point Multi-Core DSP Platform
 
In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...
In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...
In-Memory Key Value Store (KVS) in FPGA for Ultra Low Latency and High Throug...
 
High performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User GroupHigh performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User Group
 
Sparc m6 32 in-memory infrastructure for the entire enterprise
Sparc m6 32 in-memory infrastructure for the entire enterpriseSparc m6 32 in-memory infrastructure for the entire enterprise
Sparc m6 32 in-memory infrastructure for the entire enterprise
 
Introduction to FPGA acceleration
Introduction to FPGA accelerationIntroduction to FPGA acceleration
Introduction to FPGA acceleration
 
Share winter 2016 encryption
Share winter 2016 encryptionShare winter 2016 encryption
Share winter 2016 encryption
 
ODSA Use Case - SmartNIC
ODSA Use Case - SmartNICODSA Use Case - SmartNIC
ODSA Use Case - SmartNIC
 
6 open capi_meetup_in_japan_final
6 open capi_meetup_in_japan_final6 open capi_meetup_in_japan_final
6 open capi_meetup_in_japan_final
 
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
 
Why_Oracle_Hardware.ppt
Why_Oracle_Hardware.pptWhy_Oracle_Hardware.ppt
Why_Oracle_Hardware.ppt
 
Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...
Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...
Analysis of Security and Compliance using Oracle SPARC T-Series Servers: Emph...
 
Data Pipelines and Telephony Fraud Detection Using Machine Learning
Data Pipelines and Telephony Fraud Detection Using Machine Learning Data Pipelines and Telephony Fraud Detection Using Machine Learning
Data Pipelines and Telephony Fraud Detection Using Machine Learning
 
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
 
SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4
 
100 M pps on PC.
100 M pps on PC.100 M pps on PC.
100 M pps on PC.
 
Servers Technologies and Enterprise Data Center Trends 2014 - Thailand
Servers Technologies and Enterprise Data Center Trends 2014 - ThailandServers Technologies and Enterprise Data Center Trends 2014 - Thailand
Servers Technologies and Enterprise Data Center Trends 2014 - Thailand
 
Supermicro X12 Performance Update
Supermicro X12 Performance UpdateSupermicro X12 Performance Update
Supermicro X12 Performance Update
 

Recently uploaded

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

ApacheCon: Apache Commons Crypto 2017

  • 1. Apache Commons Crypto: Another wheel of Apache Commons Dapeng Sun/ Xianda Ke
  • 2. About us Dapeng Sun @Intel • Apache Commons Committer • Apache Sentry PMC Xianda Ke @Intel • Apache Commons Crypto • Apache Pig(Pig on Spark) • OpenJDK
  • 3. Agenda • Brief introduction to cryptography • What’s Commons Crypto? • Why did we create another wheel? • Performance secrets • Securing big data & API samples
  • 4. A glance at cryptographic primitives • Symmetric encryption(Secret Key) : Confidentiality DES/3DES, RC4, AES, … • Asymmetric encryption (Public Key) Authentication / Key exchange : RSA, Diffie-Hellman, ECC, ... • Hash algorithms: Integrity MD5 , SHA-1, SHA-2, GMAC(a variant of the GCM), … • Authenticated Encryption(AE): Confidentiality + Integrity RC4 + HmacMD5, RC4 + HMAC-SHA-1, AES-GCM, … • Random Number Generator PRNG(Pseudo) / TRNG(True) • mode of operation: blurs the cipher output
  • 5. What is Commons Crypto?(1) • High-performance Java cryptography library optimized with AES-NI • It wraps OpenSSL as the engine(via JNI)
  • 6. History of Commons Crypto(1) • HDFS Crypto codec • Intel AES-NI • Native library(OpenSSL) support • 17x performance improvement
  • 7. History of Commons Crypto(2) • Promote the advancement to other projects • Intel’s big data team created Chimera library • https://github.com/intel-hadoop/Chimera • Easily contribute towards the advancement of AES-NI
  • 8. History of Commons Crypto(3) •Worked with Commons community contribute to Apache Community • https://commons.apache.org/proper/commons-crypto/
  • 9. What is Commons Crypto? (2) • Low level Cipher API Only support AES algorithm now • Stream API To encrypt Stream/Channel • Random API True Random Number Generator
  • 10. JCE(Java Cryptography Extension) in hand, why did we create another wheel? background & motivation
  • 11. Don’t end up in a bottleneck… Some Java cryptographic protocols(e.g. SASL) are using inefficient or weak low-level algorithms: 3DES, RC4, … Hadoop/Spark users own very ‘big’ data… • User’s data is vulnerable to attack • Performance of JCE is the bottleneck! Take security & performance into account, JCE is impractical
  • 12. Choosing algorithm for data encryption DES is broken 3DES is too slow RC4 is ‘fast’, but weak. AES is secure prohibited by RFC 7465
  • 13. However, the problem is that AES’s performance in JDK is NOT good enough…
  • 14. * CPU: Xeon(R) CPU E5-2690 v2 @ 3.00GHz. Memory: DDR3-1600, 64 G. 14.59 228.98 297.54 1196.01 0 200 400 600 800 1000 1200 1400 3DES(JDK8) AES-CTR-128(JDK8) RC4(JDK8) AES-CTR-128(Crypto) THROUGHPUT OF SYMMETRIC ALGORITHMS (MB/S)
  • 15. 149.8 131.69 3.98 267.78 762.81 0 100 200 300 400 500 600 700 800 900 RC4+HmacMD5(JDK8) RC4+HmacSHA1(JDK8) AES-GCM(JDK8) AES-GCM(JDK9) AES-GCM(Crypto) THROUGHPUT OF AES ALGORITHMS (MB/S) * CPU: Xeon(R) CPU E5-2690 v2 @ 3.00GHz. Memory: DDR3-1600, 64 G. ~190X ~ 6X
  • 16. 6.61 86.83 0 10 20 30 40 50 60 70 80 90 100 SecureRandom(JDK8) CrytpoRandom THROUGHPUT OF RANDOM NUMBER GENERATOR (MB/S) *Java 8. CPU: Xeon(R) CPU E5-2690 v2 @ 3.00GHz. Memory: DDR3, 64 G. ~13X
  • 17. Commons Crypto is a better alternative! SECURE FAST
  • 18. Using Commons Crypto to secure your big data, and no performance bottleneck You might ask what makes crypto so fast?
  • 19. AES algorithm: each round consists of several processing steps: MixColumn, ShiftRow, Substitute bytes All these steps in a round can be done by a SINGLE instruction Performance Secret (1): AES in hardware (Intel®AES-NI) AESENC xmm1, xmm2
  • 20. Performance Secret (2): Pipelining(instruction-level parallelism) AESENC instruction takes 7 CPU clock cycles data dependence exists, instructions have to be executed one by one Pipelining instructions, 6 instructions take only 12 clock cycles
  • 21. Other performance Secrets:  Well-optimized assembly code in OpenSSL • Better SSE/AVX registers usage (x86 platform) • Data locality, etc…  Hardware acceleration in OpenSSL • Intel® Carry-Less Multiplication Instruction (PCLMULQDQ for GCM) • Intel® Secure Key (RDRAND, Random Number Generator) • in other architectures  HotSpot Intrinsics for AES are NOT well-optimized (JDK 8)
  • 22. JDK 9 is becoming fast… • JDK-8073108 enables PCLMULQDQ for AES-GCM, ~60X gain, still falls far behind Commons Crypto We’ve contributed two patches to OpenJDK (HotSpot): • JDK-8143925 x86 AES-CTR, 5~8x gain • JDK-8152354 x86 AES-CBC Decryption, 15%~50% gain But we have to wait for a few years to adopt Java 9 in our software production… 
  • 23. Big Data components are using Commons Crypto/AES-NI • AES support for over-the-wire encryption(SPARK-13331) • Add encrypted shuffle in spark (SPARK-5682) • brings 12.5% overall performance gain • Optimize HDFS Encrypted Transport performance (HDFS-6606) • brings 17x overall performance gain • Improve transparent table/CF encryption with Commons Crypto (HBASE-16463) • showed 4% to 42% gain for HFile encryption using HfilePerformanceEvaluation tool • Improve performance for RPC encryption (HBASE-16414) • improves performance about 9x when enable delegation token (in development) : Optimize Hadoop RPC encryption performance(HADOOP-10768) Replace Hadoop Common crypto code with Apache Commons Crypto(HADOOP-13635)
  • 27. Status & Future work: Status: • v1.0.0 is released. AES-CBC, AES-CTR are supported • AES-GCM ( will be released in next release) Future work : to cover more facets : • Support Asymmetric key algorithms: RSA, DSA • … How to contribute: • SCM: https://github.com/apache/commons-crypto • Apache Bugtracker (JIRA): https://issues.apache.org/jira/