在 Objective-C 中从 iDynamo Reader 读取加密数据

发布于 2024-11-06 22:07:12 字数 205 浏览 0 评论 0原文

有谁知道有 iDynamo 读卡器 的经验?该读卡器使用 DES-CBC 来加密卡数据。有谁知道如何解密这些数据?

非常感谢您抽出时间。

Does any know have experience with the iDynamo Reader? This reader is using DES-CBC to encrypt card data. Is there anyone know how to decrypt this data?

Thank so much for your time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奶气 2024-11-13 22:07:12

抱歉,如果这太晚了,但可能对其他人有帮助。所以解决方案是联系 Magtek。如果您购买 Magtek 设备,请向他们索要库。我从 Magtek 获得了 libDS247.a。然后将 DS247.h 导入到您的代码中,实现 DS247Delegate。我在这里为您提供了一个示例 -

(void)deviceDidConnect
{   
if (theAlertView.visible) 
    [theAlertView dismissWithClickedButtonIndex:0 animated:NO]; 
}

- (void)deviceDidDisconnect
{
theAlertView = [[UIAlertView alloc] initWithTitle:@"Hardware Not Connected!"
                                                 message:@"Please connect the device."
                                             delegate:self 
                                cancelButtonTitle:nil otherButtonTitles:nil];
[theAlertView show];    
[theAlertView release];
}

- (void)magneticCardReadStart
{
read = YES;
[self.tableView reloadData];
}

- (void)magneticCardReadDidFinish:(NSString *)cardString
{
read = NO;

if (trackMode == 67)
{
    NSString *string = [cardString substringWithRange:NSMakeRange(6,20)];
    self.pan1 = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(7+pan1.length,27)];
    self.name = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(8+pan1.length+name.length,4)];
    self.ed1 = string;

    self.ed2 = @"";
    self.pan2 = @"";        
}
if (trackMode == 68)
{
    NSString *string = [cardString substringWithRange:NSMakeRange(5,20)];
    self.pan2 = [[string componentsSeparatedByString:@"="] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(6+pan2.length,4)];
    self.ed2 = string;

    self.ed1 = @"";
    self.name = @"";
    self.pan1 = @"";

}
if (trackMode == 69 || trackMode == 70)
{
    NSString *string = [cardString substringWithRange:NSMakeRange(7,20)];
    self.pan1 = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(8+pan1.length,27)];
    self.name = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(9+pan1.length+name.length,4)];
    self.ed1 = string;

    string = [cardString substringWithRange:NSMakeRange(83,20)];
    self.pan2 = [[string componentsSeparatedByString:@"="] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(84+pan2.length,4)];
    self.ed2 = string;      
}
if (trackMode == 71)
{
    self.ed1 = @"";
    self.ed2 = @"";
    self.pan1 = @"";
    self.pan2 = @"";
    self.name = @"";        
}

[self.tableView reloadData];
}

应将 trackMode 设置为默认值 67,并且 cardString 是原始卡数据

Sorry if this too late but might help for someone else. So the solution is contact Magtek. If you buy Magtek device, ask them for lib. I have got libDS247.a from Magtek. Then import DS247.h to your code, implement the DS247Delegate. I provide here a sample for you-

(void)deviceDidConnect
{   
if (theAlertView.visible) 
    [theAlertView dismissWithClickedButtonIndex:0 animated:NO]; 
}

- (void)deviceDidDisconnect
{
theAlertView = [[UIAlertView alloc] initWithTitle:@"Hardware Not Connected!"
                                                 message:@"Please connect the device."
                                             delegate:self 
                                cancelButtonTitle:nil otherButtonTitles:nil];
[theAlertView show];    
[theAlertView release];
}

- (void)magneticCardReadStart
{
read = YES;
[self.tableView reloadData];
}

- (void)magneticCardReadDidFinish:(NSString *)cardString
{
read = NO;

if (trackMode == 67)
{
    NSString *string = [cardString substringWithRange:NSMakeRange(6,20)];
    self.pan1 = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(7+pan1.length,27)];
    self.name = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(8+pan1.length+name.length,4)];
    self.ed1 = string;

    self.ed2 = @"";
    self.pan2 = @"";        
}
if (trackMode == 68)
{
    NSString *string = [cardString substringWithRange:NSMakeRange(5,20)];
    self.pan2 = [[string componentsSeparatedByString:@"="] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(6+pan2.length,4)];
    self.ed2 = string;

    self.ed1 = @"";
    self.name = @"";
    self.pan1 = @"";

}
if (trackMode == 69 || trackMode == 70)
{
    NSString *string = [cardString substringWithRange:NSMakeRange(7,20)];
    self.pan1 = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(8+pan1.length,27)];
    self.name = [[string componentsSeparatedByString:@"^"] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(9+pan1.length+name.length,4)];
    self.ed1 = string;

    string = [cardString substringWithRange:NSMakeRange(83,20)];
    self.pan2 = [[string componentsSeparatedByString:@"="] objectAtIndex:0];

    string = [cardString substringWithRange:NSMakeRange(84+pan2.length,4)];
    self.ed2 = string;      
}
if (trackMode == 71)
{
    self.ed1 = @"";
    self.ed2 = @"";
    self.pan1 = @"";
    self.pan2 = @"";
    self.name = @"";        
}

[self.tableView reloadData];
}

The should set trackMode as 67 as default, and the cardString is raw card data

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文