Code Monkey home page Code Monkey logo

c-sss's People

Contributors

bernardpaulus avatar fletcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c-sss's Issues

recipe for target 'shamir' failed --> when running make

Hi all,

having a problem building the project using make from /build directory

OS: Ubuntu 18.04.1 LTS
cmake version: 3.10.2

Scanning dependencies of target libShamir
[ 11%] Building C object CMakeFiles/libShamir.dir/src/shamir.c.o
[ 22%] Building C object CMakeFiles/libShamir.dir/src/strtok.c.o
[ 33%] Linking C static library libShamir.a
[ 33%] Built target libShamir
Scanning dependencies of target shamir
[ 44%] Building C object CMakeFiles/shamir.dir/src/main.c.o
[ 55%] Building C object CMakeFiles/shamir.dir/src/d_string.c.o
[ 66%] Linking C executable shamir
/usr/bin/ld: cannot find -lbsd
collect2: error: ld returned 1 exit status
CMakeFiles/shamir.dir/build.make:121: recipe for target 'shamir' failed
make[2]: *** [shamir] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/shamir.dir/all' failed
make[1]: *** [CMakeFiles/shamir.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

memory leak bug in c-sss/src/shamir.c:517 extract_secret_from_share_strings() function

line517: the memory malloc by strdup that temp_string ponited is not free

c-sss/src/shamir.c

Lines 509 to 546 in 443953f

char * extract_secret_from_share_strings(const char * string) {
char ** shares = malloc(sizeof(char *) * 255);
char * share;
char * saveptr = NULL;
int i = 0;
/* strtok_rr modifies the string we are looking at, so make a temp copy */
char * temp_string = strdup(string);
/* Parse the string by line, remove trailing whitespace */
share = strtok_rr(temp_string, "\n", &saveptr);
shares[i] = strdup(share);
trim_trailing_whitespace(shares[i]);
while ( (share = strtok_rr(NULL, "\n", &saveptr))) {
i++;
shares[i] = strdup(share);
trim_trailing_whitespace(shares[i]);
if ((shares[i] != NULL) && (strlen(shares[i]) == 0)) {
/* Ignore blank lines */
free(shares[i]);
i--;
}
}
i++;
char * secret = join_strings(shares, i);
free_string_shares(shares, i);
return secret;
}

0 random coefficient can lead to degraded polynomial

The generated coefficients can be 0. Though improbable, if all coefficients are 0, all the shares would be the secret.

In general, the fact that the random generator can produce 0 introduces the risk of lower-order polynomials and therefore a risk of a lower number of shares needed to recover the share than required.

Ask for help when running the project!!!

Hi all,

having a problem when running the project in vs2019, in shamir.c (137,12): error C2466: cannot allocate an array of constant size 0
Before this step, I have generated the cmake project to fit in vs2019 using cmake gui tools
OS: win10
IDE: Visual Studio 2019

int * split_number(int number, int n, int t) {
    int * shares = malloc(sizeof(int) * n);
int coef[t];
int x;
int i;

by the way,what steps should I follow to run the code normally after downloading the project?can you give me some suggestions? Thank you!!!!!!

problem about time complexity

Thanks for your code and program!
I use your program in the experience of my paper. The function generate_share_strings() takes 1133s to generate share strings of a 1MB text file, but extract_secret_from_share_strings() takes 106s. This is different from what I expected. I created 100 shares and the threshold is 50.
Does generate_share_strings() take much more time than extract_secret_from_share_strings() ?

Intermittent bug

There seems to be a bug that causes the decryption process to fail sometimes. If the revealed secret doesn't look right, simply rerun the command. When this happens, either the whole secret works, or it doesn't -- there won't be one incorrect character surrounded by correct characters.

The errors still exit :(

Hi all,
I'm sorry that the errors are still existing.
I downloaded the latest version, and used the cmake-gui tool to generate the vs project,but when debuging the project in vs2019, it still display the errrors.

So I guess maybe my steps or my tools could not fit the source code. At the same time, I could not find the directions in the README(except for the "About the Source") about choosing which tools to run the program and the documentation link is banned. Could you share your tools(softwear) and your steps in deatils about running the source code? Thanks a lot!!!!!!!

pic1
pic2

Originally posted by @lamcrazy in #9 (comment)

The errors still exits :(

Hi all,
I'm sorry that the errors are still existing.
I downloaded the latest version, and used the cmake-gui tool to generate the vs project,but when debuging the project in vs2019, it still display the errrors.

So I guess maybe my steps or my tools could not fit the source code. At the same time, I could not find the directions in the README(except for the "About the Source") about choosing which tools to run the program and the documentation link is banned. Could you share your tools(softwear) and your steps in deatils about running the source code? Thanks a lot!!!!!!!

pic1
pic2

Originally posted by @lamcrazy in #9 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.