Search:

Type: Posts; User: polslinux

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    0
    Views
    2,455

    bouncy castle java --> Gcrypt C

    I have a Java app (not written by me) which uses javax.crypto to encrypt and decrypt file.



    public static final String PROVIDER = "BC";
    public static final int SALT_LENGTH = 32;
    ...
  2. Replies
    3
    Views
    6,110

    Thanks Andi :-) i will solve this after the...

    Thanks Andi :-) i will solve this after the padding problem ;-)
    @Salem: so the correct flow for the encryption program could be:
    1) read the file size, divide it by 16 and get the number of total...
  3. Replies
    3
    Views
    6,110

    c aes256 padding with pkcs#7 standard

    Encryption program:


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <gcrypt.h>


    #define GCRYPT_VERSION "1.5.0"
  4. Replies
    15
    Views
    3,469

    Also remember to alwasy check the return value of...

    Also remember to alwasy check the return value of a function.
    In your case you have to check the ret. val. of fgets and strstr :)
  5. Replies
    20
    Views
    41,775

    A little tip: use always: int main(void)neither...

    A little tip: use always:
    int main(void)neither
    main()nor
    int main() :)
  6. Replies
    16
    Views
    15,740

    I've found the bug :) The problem was that i had...

    I've found the bug :) The problem was that i had a

    recv(f_sockd, buf, sizeof(buf), 0);
    where buf is
    char buf[256] but the real received buf was only 5 chars!
    So i have changed the above...
  7. Replies
    16
    Views
    15,740

    Hello :) 1) i've deleted only the checks of the...

    Hello :)
    1) i've deleted only the checks of the open and stat calls (if ... < 0 then error):)
    2) the other 3d is for another problem :)
    3) thanks, i was desperate so i've tried all without know...
  8. Replies
    16
    Views
    15,740

    the problem is into my program because i've tried...

    the problem is into my program because i've tried to code a small socket program that exchange an int (send(sock, &val, sizeof(val), 0)) and it works perfectly -.-''
  9. Replies
    16
    Views
    15,740

    The program works perfectly the only problem is...

    The program works perfectly the only problem is when i have to send the file size because it doesn't works :(
  10. Replies
    16
    Views
    15,740

    yes, i've used it!

    yes, i've used it!
  11. Replies
    16
    Views
    15,740

    I know but it is only a personal project to...

    I know but it is only a personal project to understand and study C (and network programming) :)
    However I have built them with "make"!
    And no, "asdk" isn't in any file i've used xD
  12. Replies
    16
    Views
    15,740

    ./ftpserver 2000 ./ftpclient localhost 2000

    ./ftpserver 2000
    ./ftpclient localhost 2000
  13. Replies
    16
    Views
    15,740

    no! i'm doing some test and only me are connected...

    no! i'm doing some test and only me are connected to my network :)
  14. Replies
    16
    Views
    15,740

    c socket send int instead of a char array

    I'm running client and server on the same machine with Ubuntu 12.04-amd64 (errors checking have been deleted).

    Server send:

    uint32_t fsize;
    struct stat fileStat;
    fd = open(filename,...
  15. problem with send and receive a file and its size

    This part of code is for the client. It need to receive first the file size and then the size:


    void do_retr_cmd(int f_sockd){
    int fd;
    ssize_t nread = 0;
    uint32_t fsize, fsize_tmp,...
  16. Replies
    5
    Views
    1,755

    i've solved :D the problem was that i have to...

    i've solved :D
    the problem was that i have to put offset_list = 0; BEFORE every call to sendfile :)
  17. Replies
    5
    Views
    1,755

    With this it doesn't works :( ...

    With this it doesn't works :(


    send_again:
    rc_list = sendfile(newsockd, fpl, &offset_list, fileStat.st_size);
    if(rc_list == -1){
    perror("Invio file list non riuscito");
    ...
  18. Replies
    5
    Views
    1,755

    c sendfile doesn't works the 2nd time

    This is the part of the ftp cmd "LIST" :

    if(recv(newsockd, buffer, 5, 0) < 0){
    perror("Errore nella ricezione comando LIST");
    onexit(newsockd, sockd, 0, 2);
    }
    other =...
  19. Gooooood it woooooooooorks :D :D :D :D :D :D...

    Gooooood it woooooooooorks :D :D :D :D :D :D
    you're a fukin genius :D :D
  20. again fsize! So i have to change nread =...

    again fsize! So i have to change

    nread = read(sockd, filebuffer, fsize)
    to

    nread = read(sockd, filebuffer, fsize_tmp)
    where


    fsize_tmp = fsize
  21. Also with fsize instead of sizeof(filebuffer) i...

    Also with fsize instead of sizeof(filebuffer) i got the messages problem :(
  22. send file and then 2 messages with C socket

    This is a snippet of my client code:


    while(((uint32_t)total_bytes_read != fsize) && ((nread = read(sockd, filebuffer, sizeof(filebuffer))) > 0)){
    if(write(fd, filebuffer, nread) < 0){
    ...
  23. goto or function pointer into this pseudo-code?

    I have a doubt if to use `goto` or `pointer to a function` into my code. Here a pseuco C code using goto:



    /* code that read the answer */
    switch-case:
    switch(answer)
    case LIST:
    goto...
  24. Replies
    11
    Views
    5,167

    In fact this is a (very small) ftp client and...

    In fact this is a (very small) ftp client and server. Only USER PASS LIST CD CWD RETR have been developed :)
    And also thanks to all, i will study struct better once i've finished this project!! :)
  25. Replies
    11
    Views
    5,167

    What you have write it is too hard for me xD i'm...

    What you have write it is too hard for me xD i'm "developing" in C since May 2012 :)
    i have not completely understand "how and when to use struct" so i don't use them (for now) ;)
Results 1 to 25 of 53
Page 1 of 3 1 2 3