我正在尝试解密一个 XOR 加密文件,在使用xortool运行密钥长度测试后,我得到了这个密钥:“fallen”..
# python xortool.py -c 00 /cygdrive/c/Users/Me/Desktop/ch3.bmp
The most probable key lengths:
1: 10.6%
3: 11.6%
6: 18.5%
9: 8.8%
12: 13.8%
15: 6.6%
18: 10.4%
24: 8.1%
30: 6.4%
36: 5.2%
Key-length can be 3*n
1 possible key(s) of length 6:
fallen
Run Code Online (Sandbox Code Playgroud)
有什么方法可以使用 openssl 或 gpg 等工具解密文件(bmp 文件)并获取原始文件?他们有异或运算吗?
为了我的目的,我需要知道的是驱动器的 DOS 路径的 BitLocker 加密状态。像这样的东西:
enum DriveEncryptionStatus{
Unprotected,
Protected,
Unknown
};
DriveEncryptionStatus = GetDriveBitlockerEncryptionStatus(L"C:\\");
Run Code Online (Sandbox Code Playgroud)
我能够找到Win32_EncryptableVolume类,不幸的是,这个警告伴随着:
要使用 Win32_EncryptableVolume 方法,必须满足以下条件: 您必须具有管理员权限。
知道如何在不以管理员身份运行的情况下执行此操作吗?
在这个问题及其答案之后,我正在创建一个应用程序,该应用程序给出一个密码字符串,将转换明文并将其密文、生成的盐和初始化向量存储在文本文件中。
在以下代码中:
public String decrypt(CryptGroup cp) throws Exception {
String plaintext = null;
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
KeySpec spec = new PBEKeySpec(password, cp.getSalt(), ITERATIONS, KEY_SIZE);
SecretKey secretKey = factory.generateSecret(spec);
SecretKeySpec secret = new SecretKeySpec(secretKey.getEncoded(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(cp.getIv()));
plaintext = new String(cipher.doFinal(cp.getCipher()), "UTF-8");
return plaintext;
}
public CryptGroup encrypt(String plainText) throws Exception {
byte[] salt = generateSalt();
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
KeySpec spec = new PBEKeySpec(password, salt, ITERATIONS, KEY_SIZE);
SecretKey secretKey = factory.generateSecret(spec); …Run Code Online (Sandbox Code Playgroud) 我想要实现的是 使用在线工具在 android 中像这样的 AES CBC 解密
我不是真正的 android 开发人员,以下代码不必 100% 安全(仅作为示例)加密工作得很好,但我真的坚持解密:
一行: AESCrypt.decrypt(key2, ivBytes, todecode);
抛出异常我认为问题出在“key2”和“todecode”变量的实际数据转换上……有人知道我错过了什么吗?
设置:
private static final String TAG = "AESCrypt";
// AESCrypt-ObjC uses CBC and PKCS7Padding
private static final String AES_MODE = "AES/CBC/PKCS7Padding";
private static final String CHARSET = "UTF-8";
// AESCrypt-ObjC uses SHA-256 (and so a 256-bit key)
private static final String HASH_ALGORITHM = "SHA-256";
byte[] key = hexStringToByteArray("E0E1E2E3E5E6E7E8EAEBECEDEFF0F1F2");
SecretKeySpec key2 = new SecretKeySpec(key, 0, key.length, "AES");
byte[] ivBytes = hexStringToByteArray("12CEC438810CFA399A81139AF7D648BC"); …Run Code Online (Sandbox Code Playgroud) 是否有任何可用的库可用于PCL目标 iOS、Android 和 Windows Phone 8 应用程序Xamarin,以实现AES 256加密。
我正在尝试使用目标 c 和 C# 加密和解密字符串。两者在本机代码中都可以正常工作,但是当我尝试在 c# 中解密字符串时,在 iOS 中已加密。我得到一些错误。
这是我在目标 c 中使用的代码
- (NSData *)AES256EncryptWithKey:(NSString *)key Data: (NSData *) data
{
char keyPtr[kCCKeySizeAES256+1]; // room for terminator (unused)
bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding)
[key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
NSUInteger dataLength = [data length];
NSData *iv = [@"abcdefghijklmnopqrstuvwxyz123456" dataUsingEncoding:NSUTF8StringEncoding];
size_t bufferSize = dataLength + kCCBlockSizeAES128;
void *buffer = malloc(bufferSize);
size_t numBytesEncrypted = 0;
CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding,
keyPtr, kCCKeySizeAES256,
[iv bytes] /* initialization vector (optional) */,
[data …Run Code Online (Sandbox Code Playgroud) 我登录了我的网站,我想对日志文件进行加密。要加密日志文件,我只需将属性fileAttributes="Encrypted" 添加到配置文件中,您如何在此处看到:
<target name="file" xsi:type="File"
layout="${longdate} | ${pad:padding=-5:inner=${level:uppercase=true}} | ${message} ${onexception:inner=${newline} ${exception:format=ToString}}"
fileName="${basedir}/Log/log_info.log"
fileAttributes="Encrypted"
archiveFileName="${basedir}/Log/log_info_{#}.log"
archiveAboveSize="1048576"
archiveNumbering="Rolling"
maxArchiveFiles="2"
concurrentWrites="true"
keepFileOpen="false" />
Run Code Online (Sandbox Code Playgroud)
问题:如何解密文件以查看日志记录?
我正在尝试使用 Java 中的 BouncyCastle 使用 ECC 算法加密一些内容。但是我得到了 BouncyCastle 库的例外,说不能投射JCEECPublicKey到IESKey. 据我所知,生成的公钥KeyPairGenerator是JCEECPublicKey不能在javaCipher.init方法中使用的。有人可以告诉我如何将其转换为公钥或 X509 规范,以便我可以在加密中使用它。
这是我试过的代码
// add instance of provider class
Security.addProvider(new BouncyCastleProvider());
// initializing parameter specs secp256r1/prime192v1
ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("prime192v1");
// key pair generator to generate public and private key
KeyPairGenerator generator = KeyPairGenerator.getInstance("ECDH", new BouncyCastleProvider());
// initialize key pair generator
generator.initialize(ecSpec);
// Key pair to store public and private key
KeyPair keyPair = generator.generateKeyPair();
Cipher iesCipher = Cipher.getInstance("ECIES", new …Run Code Online (Sandbox Code Playgroud) 我需要从 Rails 应用程序中获取所有活动会话的数据。我正在使用 Redis 进行会话存储。
我试过REDIS.keys然后REDIS.get("SESSION_KEY")但它似乎是加密的数据。
是否有任何无痛的解决方案来获取 Rails 上的实时会话数据?
谢谢。
我已经从 github安装了phpseclib库,我正在尝试使用 PHP 加密密码(用于 Steam 社区)。我可以通过使用 Steam 在他们网站上的 javascript 代码来使用 Javascript 来做到这一点,但我无法使用纯 PHP 加密密码。
Javascript 加密代码:
var RSAPublicKey = function($modulus_hex, $encryptionExponent_hex) {
this.modulus = new BigInteger( $modulus_hex, 16);
this.encryptionExponent = new BigInteger( $encryptionExponent_hex, 16);
};
var Base64 = {
base64: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function($input) {
if (!$input) {
return false;
}
var $output = "";
var $chr1, $chr2, $chr3;
var $enc1, $enc2, $enc3, $enc4;
var $i = 0;
do {
$chr1 = $input.charCodeAt($i++);
$chr2 = $input.charCodeAt($i++);
$chr3 = $input.charCodeAt($i++); …Run Code Online (Sandbox Code Playgroud)