Skip to content

Commit

Permalink
add secure key generate
Browse files Browse the repository at this point in the history
  • Loading branch information
liyanboy74 committed Apr 9, 2024
1 parent 5a630da commit 73161c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Form1.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/*
HCS Programmer Soft
By Liyanboy74
https://github.com/liyanboy74
https://github.com/liyanboy74/KeeLoq
https://github.com/hnhkj/documents/tree/master/KEELOQ/docs
https://github.com/ihydrad/Keeloq-decrypt/tree/master/readme
*/

using System;
Expand Down Expand Up @@ -847,12 +851,13 @@ public ulong gen_normal_key(ulong mf_key,UInt32 seed)
return ret;
}

public ulong gen_secure_key(ulong mf_key,UInt32 seed)
public ulong gen_secure_key(ulong mf_key,UInt32 seed,UInt32 ser)
{
ulong ret = 0;

ret = ((mf_key >> 32) ^ 0) << 32;
ret |= (mf_key & 0xffffffff) ^ seed;
ret = keeloq_decrypt(mf_key, seed, KEELOQ_NROUNDS);
ser &= 0x0fffffff;
ret |= ((UInt64)keeloq_decrypt(mf_key, ser, KEELOQ_NROUNDS) << 32);

return ret;
}
Expand All @@ -873,7 +878,7 @@ public void mc_clc()
}
else if(learn_mode==3)
{
hash = gen_secure_key(mkey, seed);
hash = gen_secure_key(mkey, seed,ser);
}


Expand Down
4 changes: 2 additions & 2 deletions Programmer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectGuid>{917791B5-231E-4832-9E8C-FE4E65DAC6FB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Programmer</RootNamespace>
<AssemblyName>HCS301-Programmer-v0.2.4</AssemblyName>
<AssemblyName>HCS301-Programmer-v0.2.5</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand All @@ -23,7 +23,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.0.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down

0 comments on commit 73161c6

Please sign in to comment.