maHoa.h
10/08/2024 12:53 PM// // Created by srv_training on 23/09/2024. // #include<stdint.h> void generateKey256(char* key, int length); char* snowVencrypt(char* keyHex, char* plaintext); char* snowVdecrypt(char* keyHex, char* ciphertext); void enCryptAES(char* input, char* key, char output[256]); void deCryptAES(char* input, char* key, char output[256]); char* generateKeyRSA();
maHoa.cpp
10/08/2024 12:53 PM#include<stdio.h> #include<stdlib.h> #include<stdint.h> #include<string.h> #include<time.h> #include <malloc.h> #include <android/log.h> #define LFSR_SIZE 16 #define FSM_SIZE 3 #define key_len 256
Callnative.c
10/08/2024 12:52 PM#include <jni.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "maHoa.cpp"
#include <stdio.h>
#include <string.h>
#include <android/log.h>
JNIEXPORT jstring JNICALL
Java_com_example_chatappdemo_javaExternal_encryptAES256(JNIEnv *env, jobject instance, jstring message, jstring key)
Application,mk
10/08/2024 12:52 PMAPP_ABI := all
android.mk
10/08/2024 12:51 PMLOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cal-lib LOCAL_SRC_FILES := Callnative.c maHoa.cpp LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY)