Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help me des SSL library,THK Y.

Featured Replies

Posted

look here des soure:

https://tls.mbed.org/des-source-code

now i write code for DES ECB ENCODE:

des_const des:

setkey :

des_crype_ecb(&des,input,output);

now,encode was ok,but how i write the DES ECB decode codes?

Edited by diskgetor

Quick look on api doc, tells you use same function for encryption and decrypt 64bit block.

Always clear des context at the end and initialize it again for decrypt.

Parameters

ctx 3DES context

input 64-bit input block

output 64-bit output block

Returns

0 if successfulint mbedtls_des3_crypt_ecb ( mbedtls_des3_context * ctx,

const unsigned char input[8],

unsigned char output[8]Parameters

ctx 3DES context

input 64-bit input block

output 64-bit output block

Returns

0 if successful

Edited by b30wulf

  • Author

yeah,thank you again.the DES ECB was ok,but base64 was wrong.i write thses codes late got the VAR:base64result is : null .

-------------------------------------------------------------------------------------------------------------------------

#include "polarssl/base64.h"

#include "library/base64.c"

#include <stdio.h>

#include <string.h>

int main(void)

{

unsigned char base64mingwen[128]={"1122334455667788"};

unsigned char base64result[128]={0};

size_t dlen;//

size_t slen=128; //

dlen=strlen(base64mingwen);

base64_encode(base64mingwen,&dlen,base64result,slen);

printf("%s",base64result);

printf("\n");

getchar();

}

//the base64 source codes on here:

https://tls.mbed.org/base64-source-code

//

Edited by diskgetor

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.