purr-c/extern/libbaseencode
Érico Rolim f13c0c2e3e Add decryption for recv.
A few fixes and hacks all around, but can now do:

  ./purr -e recv (./purr -e send makefile)

And output the original page.
2020-09-13 20:17:58 -03:00
..
LICENSE Add external libbaseencode. 2020-09-13 01:06:29 -03:00
README.md Add external libbaseencode. 2020-09-13 01:06:29 -03:00
README.purr Add external libbaseencode. 2020-09-13 01:06:29 -03:00
base32.c Add external libbaseencode. 2020-09-13 01:06:29 -03:00
base64.c Add decryption for recv. 2020-09-13 20:17:58 -03:00
baseencode.h Add decryption for recv. 2020-09-13 20:17:58 -03:00
common.h Enable encrypted pastes properly. 2020-09-13 18:05:43 -03:00

README.md

libbaseencode

Coverity Scan Build Status

Library written in C for encoding and decoding data using base32 or base64 according to RFC-4648

Requiremens

  • GCC or Clang
  • CMake

Build and Install

$ git clone https://github.com/paolostivanin/libbaseencode.git
$ cd libbaseencode
$ mkdir build && cd $_
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../
$ make
# make install

How To Use It

char *b32_encoded = base32_encode(unsigned char *input, size_t input_length, baseencode_error_t *err);

unsigned char *b32_decoded = base32_decode(char *input, size_t input_length, baseencode_error_t *err);

char *b64_encoded = base64_encode(unsigned char *input, size_t input_length, baseencode_error_t *err);

unsigned char *b64_decoded = base64_decode(char *input, size_t input_length, baseencode_error_t *err);

Please note that all the returned value must be freed once not needed any more.

Errors

In case of errors, NULL is returned and err is set to either one of:

INVALID_INPUT, EMPTY_STRING, INPUT_TOO_BIG, INVALID_B32_DATA, INVALID_B64_DATA, MEMORY_ALLOCATION,

otherwise, err is set to SUCCESS