-
大小: 381KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-06-16
- 语言: 其他
- 标签:
资源简介
keeloq_C源码,包含3种加密方式的解码原代码,自己只需在此基础上稍加修改即可用于不同的项目
代码片段和文件信息
//
// Software License Agreement
//
// The software supplied herewith by Microchip Technology Incorporated
// (the “Company“) for its PICmicro?Microcontroller is intended and
// supplied to you the Company抯 customer for use solely and
// exclusively on Microchip PICmicro Microcontroller products. The
// software is owned by the Company and/or its supplier and is
// protected under applicable copyright laws. All rights are reserved.
// Any use in violation of the foregoing restrictions may subject the
// user to criminal sanctions under applicable laws as well as to
// civil liability for the breach of the terms and conditions of this
// license.
//
// THIS SOFTWARE IS PROVIDED IN AN “AS IS“ CONDITION. NO WARRANTIES
// WHETHER EXPRESS IMPLIED OR STATUTORY INCLUDING BUT NOT LIMITED
// TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT
// IN ANY CIRCUMSTANCES BE LIABLE FOR SPECIAL INCIDENTAL OR
// CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER.
//
//-------------------------------------------------------------------------
// LEGAL NOTICE
//
// The information contained in this document is proprietary and
// confidential information of Microchip Technology Inc. Therefore all
// parties are required to sign a non-disclosure agreement before
// receiving this document.
//-------------------------------------------------------------------------
// Keeloq Decryption Algorithm
//
// optimized for CCS PIC C compiler v. 2.535
//
// version 1.00 01/09/2001 Lucio Di Jasio
//
// INPUTS:
// DKEY[0..7] 64bit decryption key (pre loaded)
// Buffer[0..3] 32bit shift register (pre loaded with text to decrytp)
// OUTPUTS:
// Buffer[0..3] 32bit plain text (decrypted message)
//
//=========================================================================
unsigned int DKEY[8];
unsigned int Buffer[3];
void Decrypt()
{
unsigned int i j key aux; // 8bit variables
signed int p; // 7bit +sign
p = 1;
for (j=66; j>0; j--)
{
key = DKEY[p--];
if (p<0)
p+=8;
for (i=8; i>0; i--)
{
// NLF
if ( BIT_TEST( Buffer[3]6))
{
if ( !BIT_TEST( Buffer[3]1))
aux = 0b00111010; // 10
else
aux = 0b01011100; // 11
}
else
{
if ( !BIT_TEST( Buffer[3]1))
aux = 0b01110100; // 00
else
aux = 0b00101110; // 01
}
// move bit in position 7
if ( BIT_TEST( Buffer[2]3))
SWAP( aux);
if ( BIT_TEST( Buffer[1]0))
aux<<=2;
if (BIT_TEST( Buffer[0]0))
a
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 326582 2001-03-09 17:42 Keeloq C語言解碼\C_DECODER\00745a_c.pdf
文件 17557 2001-06-06 10:16 Keeloq C語言解碼\C_DECODER\An745_c.zip
目录 0 2005-04-23 08:44 Keeloq C語言解碼\C_DECODER
文件 185106 2001-03-09 18:00 Keeloq C語言解碼\C_DECRYPT\91041a_c.pdf
文件 4490 2001-03-14 09:47 Keeloq C語言解碼\C_DECRYPT\Tb041_c.zip
文件 3578 2001-01-10 14:19 Keeloq C語言解碼\C_DECRYPT\hitechc.c
文件 2766 2001-01-10 14:19 Keeloq C語言解碼\C_DECRYPT\genc.c
文件 3283 2001-01-10 14:04 Keeloq C語言解碼\C_DECRYPT\ccsc.c
目录 0 2005-04-23 08:44 Keeloq C語言解碼\C_DECRYPT
文件 271129 1998-10-29 15:06 Keeloq C語言解碼\NORMAL\00642b_c.pdf
文件 58039 2001-06-13 10:18 Keeloq C語言解碼\NORMAL\normal.asm
目录 0 2005-04-23 08:44 Keeloq C語言解碼\NORMAL
目录 0 2005-04-23 08:44 Keeloq C語言解碼
----------- --------- ---------- ----- ----
872748 14
- 上一篇:51读写W25X16程序
- 下一篇:多路PT100温度测量
评论
共有 条评论