Package: openmtpk
OverviewopenMTPKis an open-source (intended) mathematics package written in C++ with a primary
focus on Numbery Theory and Cryptographic algorithms, Linear Algebra, and Machine/Deep learning concepts
as well as a range of language API's. openMTPK aims to provide options for pre-built functions, models, etc.
along with modularity for user freedom.
Look in thesamplesfolder for examples
on how to use some of openMTPK's functionalities.InstallationopenMTPK C++ & Python is tested on the following:OSArchitectureStatusOSX Monterey 12.6.3x86RasPi OSARMv6/v7bullseye 11.6ARMv6ubuntu 22.10ARMv7ubuntu 22.10ARMv8ubuntu 22.10RISCV64ubuntu 22.10S390Xubuntu 22.10PPC64LENoteTesting on Apple specific hardware (M1, M2) is in progress.PythonTo install the Python interface, use the pip package manager and run the following,pip install openmtpk. Additional hardware support is available withSWIGas a dependency for the pip
installation.Build from sourceLinux/OSXCMake >=v3.24 (build from source for latest version)C++20g++12# clone repo
$ git clone git@github.com:akielaries/openMTPK.git
$ cd openMTPK
# create build dir
$ mkdir build && cd build
# create necessary objects and static library
$ cmake -S ..
$ make
# install necessary headers and library in correct directories
$ sudo make installNoteKeep the build directory for easy uninstallation. This process asumes your
STDLIB path is /usr/local/lib, where most 3rd-party libs are located if not,
run the following:$ LD_LIBRARY_PATH=/usr/local/libTo test the installation build some of the example drivers in the projectssamplesdirectory.# compile yourself
$ cd samples
$ g++ cipher.cpp -lopenMTPK -o cipher
$ g++ arith.cpp -lopenMTPK -o arith
# script to test all modules and their drivers
# using the projects root makefile
$ cd scripts && ./all.shTo uninstall files related to openMTPK, simply run the following:# enter the build dir from installation
$ cd build
$ sudo make uninstallModulesDuring early stages, modules will be developed in breadth while focusing on depth
in later stages of thePRE-V1.0.0phase. The modules below are all in progress.ArithmeticCalculusDifferentialLinear AlgebraVector OperationsMatrix OperationsMachine/Deep LearningRegressionCross-ValidationK-Nearest NeighborsNeural NetworksClassifiersNumber TheoryPrimesCryptographyTopology/ComplexDynamical SystemsTopologySplineFor more details view the projectdocumentation.ExamplesView the simple examples on how to use some of the modules in different languageshere.# clone the repo and enter
$ git clone git@github.com:akielaries/openMTPK.git 
$ cd openMTPK

# to run all examples 
$ ./all.sh

# to remove the generated binaries
$ make clean-mods

# run unit tests and other checking methods
$ make run-tests

# clean up generated test files
$ make clean-testsExample C++ driver file for running Caesar Cipher & Mono-Alphabetic Substitution
Keyword cipher:#include<iostream>#include<string>// include the number theory module header#include<openMTPK/number_theory.hpp>intmain(){// declare CIPHER class objmtpk::Ciphercc;/* CAESAR CIPHER */std::stringtext0="Plaintext";intshift_key_0=5;std::stringhashtext_0=cc.caesar(text0,shift_key_0);std::cout<<"Hashtext0 = "<<hashtext_0<<std::endl;/* TESTING MONOALPHABETIC SUBSTITUION KEYWORD CIPHER */std::stringshift_key_2="Computer";std::stringtext2="Password";// encode the plaintextstd::stringencoded_text=cc.keyword_encode(shift_key_2);// call the cipher functionstd::stringhashtext_2=cc.keyword(text2,encoded_text);std::cout<<"Hashtext2 = "<<hashtext_2<<std::endl;return0;}A Python example showing the same functionalities.#!/usr/bin/python3# import the Number Theory modulefromopenmtpkimportntc=Cipher()ciphertext_0=c.caesar('Plaintext',5)print(ciphertext_0)ciphertext_1=c.caesar('ATTACKATONCE',4)print(ciphertext_1)text="Password"shift="Computer"encoded_text=c.keyword_encode(shift);hashtext=c.keyword(text,encoded_text);print(hashtext)