c++ poco rsa 加密 java,POCO: POCO C++ Libraries 提供一套 C++ 的类库用以开发基于网络的可移植的应用程序,功能涉及线程、线程同步、文件系统访问、流操作、共...

cf513f0e1d85703e170c21d7895aee6f.png

9b6249ed673eaa16c3c6fac33195675f.png

master?svg=true

badge

POCO (Portable Components) C++ Libraries are:

A collection of C++ class libraries, conceptually similar to the Java Class Library or the .NET Framework.

Focused on solutions to frequently-encountered practical problems.

Focused on "internet-age" network-centric applications.

Written in efficient, modern, 100% ANSI/ISO Standard C++.

Based on and complementing the C++ Standard Library/STL.

Highly portable and available on many different platforms, from embedded to server.

Open Source, licensed under the Boost Software License.

5e9528bbb530131e06f614f35534aedf.png

To start using POCO, see the Guided Tour

and Getting Started documents.

Quick Start (with CMake)

Prerequisites

CMake 3.5 or newer

A C++14 compiler (Visual C++ 2015, GCC 5.0, Clang 3.4, or newer)

OpenSSL headers and libraries (optional, but recommended)

MySQL, PostgreSQL and ODBC client libraries (optional)

Most Unix/Linux systems already have OpenSSL preinstalled. If your system

does not have OpenSSL, please get it from http://www.openssl.org or

another source. You do not have to build OpenSSL yourself - a binary

distribution is fine. For example, via Debian APT:

$ apt-get install openssl libssl-dev

On macOS, the easiest way to install OpenSSL is via Homebrew:

$ brew install openssl

The easiest way to install OpenSSL on Windows is to use a binary

(prebuild) release, for example the one from Shining Light

Productions that comes with a

Windows installer.

On Windows, POCO can also use the native Windows TLS APIs (SChannel).

Installing All Dependencies (Linux and macOS)

All dependencies can be installed with the following commands:

Debian Linux (including Ubuntu and Raspbian)

$ sudo apt-get -y update && sudo apt-get -y install git g++ make cmake libssl-dev

RedHat Linux

$ sudo yum install -y git gcc-c++ make cmake3 openssl-devel

macOS (with Homebrew)

$ brew install cmake openssl

Building with CMake (Linux, macOS, Windows)

CMake (version 3.5 or newer) is the recommended build system for

building the POCO C++ Libraries.

$ git clone -b master https://github.com/pocoproject/poco.git

$ cd poco

$ mkdir cmake-build

$ cd cmake-build

$ cmake ..

$ cmake --build . --config Release

On macOS, it's necessary to tell CMake where to find the OpenSSL headers

and libraries by setting the OPENSSL_ROOT_DIR CMake variable.

For example, if OpenSSL has been installed with Homebrew,

the cmake invocation becomes:

$ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl

Other common ways of building with CMake (e.g., cmake-gui) will also work.

There are also a number of project-specific CMake variables that can be changed.

Cross-Compiling

With a proper CMake toolchain file (specified via the CMAKE_TOOLCHAIN_FILE CMake variable),

the POCO C++ Libraries can be cross-compiled for embedded Linux systems:

$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/mytoolchain.cmake -DCMAKE_INSTALL_PREFIX=/path/to/target

Installing

The POCO C++ Libraries headers and libraries can be optionally be installed by building the install target.

$ sudo cmake --build . --target install

The default install location is /usr/local/ on Linux and macOS and

C:\Program Files (x64)\ on Windows and can be overridden by setting

the CMAKE_INSTALL_PREFIX CMake variable.

Building Without CMake

If you do not want to or cannot use CMake, POCO can also be built with Visual Studio

(project and solution files included) or GNU Make (Linux, macOS and other supported Unix platforms).

Please refer to the documentation for more information.

Getting POCO via a Package Manager

POCO can also be obtained via different package managers.

Community and Contributing

POCO has an active user and contributing community, please visit our website and blog.

Answers to POCO-related questions can also be found on Stack Overflow.

Please see CONTRIBUTING for submitting contributions, bugs reports, feature requests or security issues.

POCO vs. Boost

In regards to Boost, in spite of some functional overlapping,

POCO is best thought of as a Boost complement (rather than replacement).

Side-by-side use of Boost and POCO is a very common occurrence.

众所周知,Java编译后的Jar包和Class文件,可以轻而易举的使用反编译工具(如JD-GUI)进行反编译,拿到源码。为了保护自己发布的Jar包和Class文件,采用的方式大多是混淆方式,这种方式对于Class文件的加密是不彻底的,还是能够通过分析得出核心算法。本工具是采用jvmti方式对Class文件进行加密,使用C++生成加密和解密库,先用加密库对Jar包进行加密,将加密后的Jar包及解密库文件发布出去,执行时候需要JVM引入解密库文件,解密后执行。c++的.dll文件和.so文件的破解难度是很大的,这就能有效的保护软件和代码的知识产权. 使用方法: 1.打开windows命令行(运行=>cmd=>回车),在命令行中 进入 EncryptJar目录 2.执行 java -jar encrypt.jar 3.输入h,然后回车,可以看到帮助菜单 4.输入3,然后按回车键,进入加入jar文件功能 5.输入要加密的jar文件的路径 6.提示输入秘钥(key)的时候,直接回车,不要输入任何字符(否则后面classhook将不可解密加密后的jar包) 7.输入目标路径(加密后的jar文件路径,此处要注意:jar文件名要保持相同,将加密后的文件保存到不同的目录) 8.将加密后的jar包,替换原来的没有加密的jar包,与要发布的程序一起进行发布.(一般替换lib目录下对应的jar包即可) 9.加密后的jar包运行方法: windows下: 拷贝libClassHook.dll文件到程序的根目录(通常为要执行的jar程序的根目录) 使用以下命令启动程序: java -agentlib:libClassHook -jar xxxxxxxxxxx.jar 则在运行过程中会自动进行解密操作(解密过程是运行过程中用c++的dll进行解密的,可以有效防止破解class文件) 如果执行过程报错,可将程序根目录添加到环境变量path中去 Linux下: 拷贝libClassHook.so到程序的根目录(通常为要执行的jar程序的根目录) 使用以下命令启动程序: java -agentlib:ClassHook -jar xxxxxxxxxxx.jar (这里要删除掉lib,linux系统下会自动补全) 则在运行过程中会自动进行解密操作(解密过程是运行过程中用c++的dll进行解密的,可以有效防止破解class文件) 如果执行过程报错,可以在程序根目录下执行以下语句:export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH 或将libClassHook.so 拷贝到/usr/lib目录中去。 支持操作系统:加密请在windows64位系统并安装了64位jdk环境下进行。 需要解密运行的程序支持LINUX(64位)和windows(64位)安装了JDK1.8以上的系统。 测试程序: (t_lib目录下的jar包为经过加密的jar包) java -agentlib:libClassHook -jar test.jar
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值