old question

Discussions related to the firmware code development
Post Reply
mioumiou
Posts: 1
Joined: Thu Jul 01, 2021 6:32 pm

old question

Post by mioumiou » Thu Jul 01, 2021 6:43 pm

.
Last edited by mioumiou on Thu Jul 08, 2021 4:26 pm, edited 1 time in total.

majonez
Posts: 7
Joined: Thu Jan 14, 2021 8:52 am

Re: Encryption code

Post by majonez » Sat Jul 03, 2021 6:01 am

Hello, i'm doing "encyption" like this:

Code: Select all

void codecDecode(uint8_t *indata_ptr, int numbBlocks)
{
	int errs1;
	int errs2;
.......
.......
    for (int idx = 0; idx < numbBlocks; idx++)
    {

    	if (uiDataGlobal.QuickMenu.tmpDmrEncrypt) { //<--new UI variable, can skip this condition for testing
    		for (int i = 0; i < 9; i++) {
    			if(indata_ptr[i]) indata_ptr[i]^=0xFF; //<-secret key
    		}
    	}
........
........
}  //end codecDecode

void codecEncodeBlock(uint8_t *outdata_ptr)
{
...
...
	for (int i = 0; i < 72; i++)
	{
		if (bitbuffer_encode[i] & 1)
		{
			outdata_ptr[i >> 3] |= 128 >> (i & 7);
		}
	}

	if (uiDataGlobal.QuickMenu.tmpDmrEncrypt) { //<--new UI variable, can skip this condition for testing
		for (int i = 0; i < 9; i++) {
				if(outdata_ptr[i]) outdata_ptr[i]^=0xFF; //<--secret key

		}
	}
....
....
} //end codecEncodeBlock
This works, but it's totally out of specs i guess.
According to the documentation of c6000 chip, it should support an encryption by itself.

Post Reply