⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bcinfo.c

📁 加密解密,安全工具!很有意思的代码
💻 C
字号:
/*********************************************************************      Copyright (c) 1994-1999 Jetico, Inc., Finland*      All rights reserved.**      File: bcinfo.c*      Revision: $Id: bcinfo.c,v 1.9 2005/05/14 11:19:24 nail Rel-1.6-3 $*      Created:*      Description: implementation of container info routine********************************************************************/#include <stdio.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>#include <string.h>#include <kg_defs.h>#include "header.h"#include "config.h"#include "bctool.h"#include "misc.h"#include "error.h"char bcinfo_c[]="$Id: bcinfo.c,v 1.9 2005/05/14 11:19:24 nail Rel-1.6-3 $";int bcinfo (int argc, char ** argv){    struct HiddenSector  hs;    int fd;    alg_info *alg_inf;    char *algorithm,*fsys;    if ( argc < 2 )    {        msg(stderr,"Please specify container name\n");         return -1;     }    else if ( argc > 2 )    {        msg(stderr,"Too many parameters\n");        return -1;    }    if ( (fd = open(argv[1], O_RDONLY|O_LARGEFILE)) < 0 )    {        perror (argv[1]);        return -1;     }    if ( read(fd, &hs, sizeof(hs))!=sizeof(hs) )    {        msg(stderr,"Can not read container header\n");        return -1;     }    if ( strncmp(hs.br.OEMid, "LOCOS94 ", sizeof(hs.br.OEMid))!=0 )    {        msg(stderr,"%s is not valid BestCrypt container\n",argv[0]);        return -1;    };       if ( (alg_inf=GetInfoById(hs.algorithmId))==NULL )        algorithm="Unknown algorithm";    else algorithm=alg_inf->alg_name;    if ( (fsys=getFStypeById(hs.fileSystemId))==NULL )        fsys="Unknown filesystem";    msg(stdout,"Description: %s\nEncryption Algorithm: %s\nKey Generator: %s\nFilesystem: %s\n",           hs.description,algorithm,hs.keyGenId == KGSHA256_ID ? "SHA-256" : "SHA-1", fsys);    close(fd);    return 0;} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -