From c5a798beec0f24f6828cd3c43bbefd1e18a9d33a Mon Sep 17 00:00:00 2001 From: Bakasura Date: Mon, 13 Jul 2020 18:27:27 -0500 Subject: FiSHLiM: Support for CBC mode + more commands (#2347) --- plugins/fishlim/fish.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'plugins/fishlim/fish.h') diff --git a/plugins/fishlim/fish.h b/plugins/fishlim/fish.h index 238f52e7..daf17acf 100644 --- a/plugins/fishlim/fish.h +++ b/plugins/fishlim/fish.h @@ -1,6 +1,7 @@ /* Copyright (c) 2010 Samuel Lidén Borell + Copyright (c) 2019 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -29,10 +30,18 @@ #include -char *fish_encrypt(const char *key, size_t keylen, const char *message); -char *fish_decrypt(const char *key, size_t keylen, const char *data); -char *fish_encrypt_for_nick(const char *nick, const char *data); -char *fish_decrypt_from_nick(const char *nick, const char *data); +enum fish_mode { + FISH_ECB_MODE = 0x1, + FISH_CBC_MODE = 0x2 +}; + +char *fish_base64_encode(const char *message, size_t message_len); +char *fish_base64_decode(const char *message, size_t *final_len); +char *fish_encrypt(const char *key, size_t keylen, const char *message, size_t message_len, enum fish_mode mode); +char *fish_decrypt(const char *key, size_t keylen, const char *data, enum fish_mode mode, size_t *final_len); +char *fish_decrypt_str(const char *key, size_t keylen, const char *data, enum fish_mode mode); +char *fish_encrypt_for_nick(const char *nick, const char *data, enum fish_mode *omode); +char *fish_decrypt_from_nick(const char *nick, const char *data, enum fish_mode *omode); #endif -- cgit 1.4.1