Raised This Month: $51 Target: $400
 12% 

String Encryptor API


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-12-2024 , 05:39   String Encryptor API
Reply With Quote #1

String Encryptor API
- v0.0.1, published at : 12/01/2024


Description
A simple tool to encrypt your string data. This allows you to encrypt by using Caeser Cipher, X0R and Fibonacci.


How to use it
PHP Code:
enum {
    
Caeser_Cipher,
    
X0R,
    
Fibonacci
}

/**
 * Encrypt a String
 *
 * @param iMethod    Caeser_Cipher / X0R / Fibonacci
 * @param szInput    Original String
 * @param szOutput    Output (Encrypted)
 * @param iMaxLen    Output Max Lenght
 * @param iKey        Used for X0R & Caeser Cipher Methods
 */
native str_encrypt(iMethod, const szInput[], szOutput[], iMaxLeniKey 0)

/**
 * Decrypt a String
 *
 * @param iMethod    Caeser_Cipher / X0R / Fibonacci
 * @param szInput    Encrypted String
 * @param szOutput    Output (Decrypted String)
 * @param iMaxLen    Output Max Lenght
 * @param iKey        Used for X0R & Caeser Cipher Methods
 */
native str_decrypt(iMethod, const szInput[], szOutput[], iMaxLeniKey 0
The important note here is the iKey.
  • Fibonacci does not require a key.
  • On Caeser Cipher you must use a key. I would recommend a value between 2 and 10.
  • On X0R method you should also use a key, you can find bellow some key examples.


X0R Example Keys
  • 0x42
  • 0x7F
  • 0xAA
  • 0xF0
  • 0x88
  • 0xC5
  • 0x3E
  • 0xD7
Attached Files
File Type: sma Get Plugin or Get Source (encryptor_api.sma - 72 views - 1.9 KB)
File Type: inc encryptor.inc (798 Bytes, 27 views)
__________________

Last edited by Jhob94; 01-12-2024 at 05:41.
Jhob94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-12-2024 , 05:46   Re: String Encryptor API
Reply With Quote #2

For futher understanding on how to use this API you can check this plugin that i've made for a quick test.

Keep in mind that this plugin is just made for testing as encrypted results that include quotes will terminate the console command while trying to decrypt.


This is the output of test plugin:
HTML Code:
encrypt_cipher "Encryptor API"
Irgv}txsv$ETM

] decrypt_cipher "Irgv}txsv$ETM!"
Encryptor API

] encrypt_fib "Version 0.0.1"
Wguxq|Bg@*

] decrypt_fib "Wguxq|Bg@*"
Version 0.0.1

] encrypt_x0r "Made by Jhob94"
;>?z8#z258cn

] decrypt_x0r ";>?z8#z258cn"
Made by Jhob94
Attached Files
File Type: sma Get Plugin or Get Source (encryptor_test.sma - 48 views - 2.3 KB)
__________________

Last edited by Jhob94; 01-12-2024 at 05:47.
Jhob94 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 01-13-2024 , 08:09   Re: String Encryptor API
Reply With Quote #3

this is not an api more of a library and you should probably post this on code snippets
__________________
bigdaddy424 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-13-2024 , 09:34   Re: String Encryptor API
Reply With Quote #4

Quote:
Originally Posted by bigdaddy424 View Post
this is not an api more of a library and you should probably post this on code snippets
This is an interface, not a stock. I could had built it like a stock yes, but I didn’t. Probably i will add more features to this plugin some day.

So.. If it is an interface, not a stock, not a tutorial and not a module, this is the right place.
__________________
Jhob94 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 01-13-2024 , 09:58   Re: String Encryptor API
Reply With Quote #5

its not an interface and neither a library. its just a function that `encrypts` text least safest way. if someone finds it reasonable to encrypt text inside a game id assume theyd go for something more secure, hash_* functions already have some pretty solid encrypt models to choose from.
__________________
bigdaddy424 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-13-2024 , 16:55   Re: String Encryptor API
Reply With Quote #6

I would argue that a "plugin submission" is for end-user plugins, not tools for developers (which may become dependencies of actual end-user plugins.
__________________
fysiks is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-13-2024 , 22:04   Re: String Encryptor API
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
I would argue that a "plugin submission" is for end-user plugins, not tools for developers (which may become dependencies of actual end-user plugins.
If that’s case, which as far as i know is not specified anywhere, where should i post this or my virtual weapons slots api?
__________________
Jhob94 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-14-2024 , 15:05   Re: String Encryptor API
Reply With Quote #8

Code Snippets/Tuts is more fitting IMO
__________________
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode