Code Monkey home page Code Monkey logo

hadoopencyption's Introduction


Encryption/DEcryption in Hadoop

Encryption is must when storing data obtained from IoT devices.

View Demo · Report Bug · Request Feature

To install hadoop
->install java-jdk 8.
->install hadoop 3.2.3 from hadoop archive.
->customize the shell environment in Linux with:: sudo nano .bashrc

-> copy and pase these in the end of the file

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:/usr/lib/jvm/java-8-openjdk-amd64/bin
export HADOOP_HOME=~/hadoop-3.2.3/
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native"
export HADOOP_STREAMING=$HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-3.2.3.jar
export HADOOP_LOG_DIR=$HADOOP_HOME/logs
export PDSH_RCMD_TYPE=ssh

->open hadoop-env.sh:: sudo nano hadoop-env.sh and add this line JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

->open core-site.xml:: sudo nano core-site.xml and add these lines

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>
    <property>
        <name>hadoop.proxyuser.dataflair.groups</name <value>*</value>
    </property>
    <property>
        <name>hadoop.proxyuser.dataflair.hosts</name <value>*</value>
    </property>
    <property>
        <name>hadoop.proxyuser.server.hosts</name <value>*</value>
    </property>
   <property>
        <name>hadoop.proxyuser.server.groups</name <value>*</value>
    </property>
</configuration>

--> open hdfs-site.xml:: sudo nano hdfs-site.xml and these lines

<configuration>
   <property>
         <name>dfs.replication</name><value>1</value>
   </property>
</configuration>

--> open mapred-site.xml:: sudo nano mapred-site.xml and these lines

<configuration>
   <property>
       <name>mapreduce.framework.name</name> <value>yarn</value>
   </property>
   <property>
       <name>mapreduce.application.classpath</name>
       <value>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/</value>
   </property>
</configuration>

--> open yarn-site.xml:: sudo nano yarn-site.xml and these lines

<configuration>

<!-- Site specific YARN configuration properties -->
  <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <property>
        <name>yarn.nodemanager.env-whitelist</name>
        <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,CLASSPATH_PREP END_DISTCACHE,HADOOP_YARN_HOME,HADOOP_MAPRED_HOME</value>
    </property>
</configuration>

--> To start hadoop use start-all.sh
-->To stop hadoop use stop-all.sh


--> Open project using IntelliJ, and install maven.
--> Now clean and install maven to get the jar file.
--> Now First generate RSA keys with hadoop jar target/HadoopEncryption-1.0-SNAPSHOT.jar org.hadoopEncryption.RSA
--> Now generate AES keys with hadoop jar target/HadoopEncryption-1.0-SNAPSHOT.jar org.hadoopEncryption.AES
--> To Encrypt file and store it into hadoop use

hadoop jar target/HadoopEncryption-1.0-SNAPSHOT.jar org.hadoopEncryption.aesEncryptJob file:///home/ubuntu/plain_text_file.txt output_file_name_must_be_unique_for_every_use

--> To Decrypt file and store it into hadoop use

hadoop jar target/HadoopEncryption-1.0-SNAPSHOT.jar org.hadoopEncryption.aesDecryptJob file:///home/ubuntu/cipher_text_file.txt output_file_name_must_be_unique_for_every_use

hadoopencyption's People

Contributors

kartikay304 avatar

Stargazers

Kartik Makhloga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.