Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algorithm independent encryption and decryption support #290

Open
godrays opened this issue Oct 23, 2021 · 0 comments
Open

Algorithm independent encryption and decryption support #290

godrays opened this issue Oct 23, 2021 · 0 comments

Comments

@godrays
Copy link

godrays commented Oct 23, 2021

Hello!

I would love to see rpclib supports binding an encoding and a decoding method to provide multi use case data manipulation support. @sztomi

Example Use Case 1
Users apply their encryption algorithm on final data before data is sent.
Users apply their decryption algorithm on final data after data is received.

Example Use Case 2
The same idea with use case 1 but applying zip compression and decompression on data.

Binding methods for client side:

Client  client(....);

// The bound method will be called right before data is sent.
client.encode([](<const vector<char> & blob_data>) {

    vector<char>   encrypted_data;

    // Apply encryption or encoding on blob_data to create encrypted_data and return. The new data size will be different.

    return encrypted_data;
});

client.call("TestFunc", .....);

Binding methods for server side:

Server  server(....);

// The bound method will be called right after data is received.
server.decode([](<const vector<char> & blob_data>) 
{
    vector<char>   decrypted_data;

    // Apply decryption or decoding on blob_data and return new data. The new data size will be different.

    return decrypted_data;
});

server.bind("TestFunc", .....);

I hope that makes sense. Basically, rpclib will provide algorithm independent data manipulation support.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant