Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Cryptography development environment to build under Ubuntu     - Depth understanding of the TCP protocol (Database)

- Correlation Analysis: FP-Growth algorithm (Programming)

- Linux Samba server-side structures and the use of the client (Server)

- GitLab installation configuration notes (Linux)

- Linux Shell debugging (Programming)

- Oracle 11g upgrade PSU detailed steps (Database)

- Use in Linux ipmitool tool (Linux)

- Service manager OpenBSD on rccl (Server)

- Ten best plug surge Emacs Productivity (Linux)

- Getting Started with Linux: CentOS7 Install Mono with the yum command (Server)

- NET Developers need to know some Linux commands (Linux)

- Mac OS X 10.9 compiler OCI8 module (Programming)

- Linux and Unix systems really do network more secure (Linux)

- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)

- MongoDB Learning the notes (Database)

- Docker study notes (Server)

- JavaScript prototype and prototype chain and project combat (Programming)

- Teach you how to protect the Linux operating system security tips (Linux)

- Oracle Automatic Diagnostic Repository (Automatic Diagnostic Repository, ADR) (Database)

- Memcached source installation and configuration under CentOS 6.6 (Server)

  Cryptography development environment to build under Ubuntu
  Add Date : 2017-04-30      

Since recently doing some projects on cryptography, and cryptography libraries are most dependent on the Linux open-source environment, so build cryptography development environment in Ubuntu becomes very necessary. This article describes the steps necessary to build cryptography development environment in Ubuntu, at the same time some minor settings to enhance the experience.

Ubuntu system is installed and set up the root account.

I installed Ubuntu 13.10. Since the development process requires frequent changes of various conf file or modify / usr file folder, so administrator privileges under sudo clearly unable to meet our needs, we need to establish the root account, so that we can carry out future work.

First, open the root account, set the root password

sudo passwd root

Then enter the new password twice when prompted, this time you can use root privileges logged. But if we log out, you will find the system does not allow us to use the root account login, after entering the account must be further elevated privileges, which obviously can not meet our needs. This is because ubuntu hidden by default root account reason. So you want to modify the configuration.

Modify the configuration lightdm

Open Terminal, modify /etc/lightdm/lightdm.conf.d/10-ubuntu.conf file:

sudo gedit /etc/lightdm/lightdm.conf.d/10-ubuntu.conf add the following

greeter-show-manual-login = true # Allows manual input system login user name and password

allow-guest = true # allow guest login

It is worth mentioning that in some low ubuntu version, you need to modify /etc/lightdm/lightdm.conf file, modify the method above.

In this way, we can choose to root account login.

Second. Ubuntu under Eclipse installation and configuration

My main job is to carry out Java / Android development, the bottom layer of the call is to use the C library, is to use jni / NDK calls. Thus, Eclipse is a suitable development tools.

1. Eclipse installation

Download the latest version of Eclipse is https://www.eclipse.org/downloads/ to note that, Eclipse 32-bit systems and 64-bit systems are different, be careful when downloading.

ubuntu, the test system is 32-bit or 64-bit has two methods:

1, terminal, enter uname -m returns i686 is the 32-bit system returns x86_64 is the 64-bit system;

2, terminal, enter getconf LONG_BIT, this command returns the length of the system is long data type, if the return system 32 is 32, 64 is 64-bit systems.

After downloading extract to / usr / local / java folder.

2.Eclipse Bug fixes

It should be noted, there is unity interface ubuntu12.10 after bug, and eclipse interface uses unity interface agent, resulting in a great chance not display eclipse menu, you must create a new shortcut in order to open the option to disable menu Agent Mode Eclipse (if installed open Eclipse, you can find yourself using the menu bar, you can skip this step). Solutions are as follows:
1. Create a new shortcut.
In any folder (in desktop) New -> Blank Document, and enter the following code

[Desktop Entry]
Categories = Development;
Comment [zh_CN] =
Comment =
Exec = env UBUNTU_MENUPROXY = / usr / local / java / eclipse / eclipse
GenericName [zh_CN] = IDE
GenericName = IDE
Icon = / usr / local / java / eclipse / icon.xpm
MimeType =
Name [zh_CN] = eclipse
Name = eclipse
Path =
StartupNotify = true
Terminal = false
Type = Application
X-DBUS-ServiceName =
X-DBUS-StartupType =
X-KDE-SubstituteUID = false
X-KDE-Username = owen
Exec = env UBUNTU_MENUPROXY = 0 / usr / local / java / eclipse / eclipse
Key statement

Exec = env UBUNTU_MENUPROXY = 0 / usr / local / java / eclipse / eclipse
Its role is to disable the agent menu.
After saving and launched, will rename the file to eclipse.desktop, right to increase the file permissions, and check whether the correct command

Double-click the desktop icon to open up, pull-down menus can also be achieved. If there is demand, but also can be fixed on the start bar.
Eclipse itself comes with JDK version, but I still want to install separate jdk, so at some need the command line compiler, they can easily call and javah javac command, so a pure download the Eclipse, and with Oracle- jdk, JDK Download 8 is http://www.oracle.com/technetwork/java/javase/downloads/index.html. If openJDK, direct apt-get install to install.
After downloading decompression, decompression good jdk1.8.0_5 folder to / usr / lib / jvm directory, this time even without jvm directories can also execute the following command, jvm folder will be created.

mv jdk1.8.0_5 / usr / lib / jvm
Modify the following environment variable to any directory can be called Java command. Modify / etc / profile

gedit / etc / profile
Added at the end:

export JAVA_HOME = / usr / lib / jvm / jdk1.8.0_5
export JRE_HOME = / usr / lib / jvm / jdk1.8.0_5 / jre
export CLASSPATH =:. $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar: $ JAVA_HOME / lib: $ JRE_HOME / lib: $ CLASSPATH

export PATH = $ JAVA_HOME / bin: $ PATH
Note that there are two points, one CLASSPATH first colon in front of a small point, refers to the "current directory" must be added; the second is to replace jdk1.8.0_5 own Java version.
After saving execution:

source / etc / profile
This completes the configuration of java environment variable. Test environment variable is correctly configured as follows:

java -version
Display the following on behalf of Java is configured correctly:

java version "1.8.0_05"
Java (TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot (TM) Server VM (build 25.5-b02, mixed mode)
Eclipse in C / C ++ development needs CDT plug-ins, CDT plug-in installation method is as follows:
Start Eclipse, select Help> Install New Software;
In the Available Software dialog box, click the Add ...;
In the Name field Add Site dialog box, enter the name of the remote site (for example, "C Plugin"). In the Location field, enter the following URL: http: //download.eclipse.org/tools/cdt/releases/kepler Click OK, pending then select all the options below, all the way to the next step to complete the installation.

3.andorid sdk environment to build

Eclipse ADT (Android Developer Tools) installation
Start Eclipse, select Help> Install New Software.
In the Available Software dialog box, click Add ...,

In the Name field Add Site dialog box, enter the name of the remote site (for example, "Android Plugin"). In the Location field, enter the following URL: https: //dl-ssl.google.com/android/eclipse/ NOTE: If you have trouble accessing the plug-in, URL can be changed in the https http (https will use more secure). Click OK.
Back Available Software interface should be able to see a list of the Developer Tools option. Select Developer Tools beside the check box will also select Android DDMS and Android Development Tools. Click Next.
In the final Install Details dialog box lists the Android DDMS and Android Development Tools and other features. Click Next to read and accept the license agreement, and install all dependent components, and then click Finish.
Restart Eclipse.

3. Install the android sdk

After the restart Eclipse, you'll be prompted, Android SDK does not give a location

Now we need to cut out and download the Android SDK Tools, the following address: http://developer.android.com/sdk/index.html

Download the SDK Tools Only you can. After downloading extract to any folder. Cut back to Eclipse, the path to the SDK Android SDK Tools just unpack location, and then all the way to the next step to install the sdk. If you need additional later version of SDK, open the Android SDK Manager to download.
In order to let the SDK can also be used in Terminal, sdk configuration environment variable, edit / etc / profile

sudo gedit / etc / profile
Added at the end:

# Android SDK
export ANDROID_SDK = ~ / developTools / android-sdk-linux
export PATH = $ ANDROID_SDK / platform-tools: $ ANDROID_SDK / tools: $ PATH
Do not forget to add the complete input Terminal in

source / etc / profile
Test: emulator -version

4. Install the Android NDK
NDK needed in some need to call C library scene. NDK download address is:
After downloading extract to any folder, and configure the same environment variables as sdk

sudo gedit / etc / profile
Added at the end:

export NDK_HOME = / home / snowdream / android-ndk-r5
export PATH = $ NDK_HOME: $ PATH
Remember to substitute your own path extracting the NDK path.

Do not forget to add the complete

source / etc / profile

Test: input Terminal

ndk-build -version
The results will show the correct version numbers of ndk-build.

Environment installed.

Third, the cryptography libraries installed

First install pbc series library.

1. pbc dependent libraries installation
pbc library depends on
GMP Library
Wherein M4, flex, bison can be installed via apt-get install

apt-get install M4
  apt-get install flex
  apt-get install bison
GMP download the following address:
Download and unzip, unzip the file into the folder where the terminal is installed, as follows:

make check
make install
2. pbc installation
pbc (The Pairing-Based Cryptography Library) Download the following address:

Download and unzip, unzip the file into the folder where the terminal is installed, as follows:

    make install
Thus, cryptography complete development environment to build. If you need to develop Java / Android project, we will need some knowledge JNI / NDK development of. Fortunately, the library has been JPBC pbc version, with the same Download Download pbc, its essence is a java library pbc interface, so it is still dependent on the pbc library. Here are a direct method of generating libjpbc-pbc.so dynamic link library, it does not rely on pbc libraries, but note that if pbc library itself has changed, then you need to re-build the library file. In addition, the author does not guarantee that this method of generating sufficiently stable.
This method relies on cmake and ccmake, both for the common programming tool, installation is as follows

apt-get install cmake
    apt-get install cmake-curses-gui
After installation, at teminal enter jpbc extract the directory (with < jpbc> on behalf of that), enter

cd < jpbc> / jpbc-pbc
Like the use of make, type c, and then enter g, this time in < jpbc> / jpbc-pbc folder generates the necessary Makefile file

Then enter

so this file is java library that can be called, at the time of calling attention to setting java.library.path.

Although our basic development environment set up is completed, however, depending on each person's needs, we need to download a separate library files they need, for example, frequently used openSSL.
- Linux character device - automatically creates the device nodes and devices (Linux)
- How do I use Linux development environment (Linux)
- Learn to read the source code of vmstat (Linux)
- Spark read more HBase tables a RDD (Server)
- Linux environment variable configuration (Linux)
- C ++ precision performance test function (Programming)
- VMware virtual machine operating system log Error in the RPC receive loop resolve (Linux)
- Linux Network Programming --IP packet format Detailed (Programming)
- Linux Security Module (LSM) Introduction (Linux)
- Nginx server load balancing dual-system availability (Server)
- Hadoop 2.6.0 stand-alone / pseudo-distributed installation (Server)
- RedHat Linux 9.0 under P4VP-MX motherboard graphics resolution of problems (Linux)
- MyCAT read and write separation of MySQL (Database)
- Linux system security configuration (Linux)
- Java interface (Programming)
- Oracle 12c users create (Database)
- Recover accidentally deleted Nginx logs (Server)
- Scope of variables in C # (Programming)
- Linux foreground to background process switch (Linux)
- How to Install Sticky Notes on Ubuntu and Derivatives (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.