Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
openMTPK is 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 the samples folder for examples on how to use some of openMTPK's functionalities.
openMTPK C++ & Python is tested on the following:
OS | Architecture | Status |
---|---|---|
OSX Monterey 12.6.3 | x86 | |
RasPi OS | ARMv6/v7 | |
bullseye 11.6 | ARMv6 | |
ubuntu 22.10 | ARMv7 | |
ubuntu 22.10 | ARMv8 | |
ubuntu 22.10 | RISCV64 | |
ubuntu 22.10 | S390X | |
ubuntu 22.10 | PPC64LE |
Note Testing on Apple specific hardware (M1, M2) is in progress.
To install the Python interface, use the pip package manager and run the following, pip install openmtpk
. Additional hardware support is available with SWIG as a dependency for the pip
installation.
# 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 install
Note Keep 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/lib
To test the installation build some of the example drivers in the projects samples directory.
# 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.sh
To uninstall files related to openMTPK, simply run the following:
# enter the build dir from installation
$ cd build
$ sudo make uninstall
During early stages, modules will be developed in breadth while focusing on depth
in later stages of the PRE-V1.0.0
phase. The modules below are all in progress.
For more details view the project documentation.
View the simple examples on how to use some of the modules in different languages here.
# 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-tests
Example 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>
int main() {
// declare CIPHER class obj
mtpk::Cipher cc;
/* CAESAR CIPHER */
std::string text0 = "Plaintext";
int shift_key_0 = 5;
std::string hashtext_0 = cc.caesar(text0, shift_key_0);
std::cout << "Hashtext0 = " << hashtext_0 << std::endl;
/* TESTING MONOALPHABETIC SUBSTITUION KEYWORD CIPHER */
std::string shift_key_2 = "Computer";
std::string text2 = "Password";
// encode the plaintext
std::string encoded_text = cc.keyword_encode(shift_key_2);
// call the cipher function
std::string hashtext_2 = cc.keyword(text2 , encoded_text);
std::cout << "Hashtext2 = " << hashtext_2 << std::endl;
return 0;
}
A Python example showing the same functionalities.
#!/usr/bin/python3
# import the Number Theory module
from openmtpk import nt
c = 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)
FAQs
openMTPK Python API
We found that openmtpk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.