public byte[] DecryptHeader() { try { if (FirmwareRaw != null) { if (FirmwareRaw.Length > 512) { var iv = FirmwareIV(); var key = KeyHandler.Aes256; var fileName = @"header.rawBytes"; var rawHeader = FirmwareSigned.ByteSelect(640, 543); var dec = CryptoHandler.AesDecrypt(rawHeader, key, iv); File.WriteAllBytes(fileName, dec); } } } catch (Exception ex) { UiMessages.Error(ex.ToString()); } //default return(null); }
public byte[] SignedSHA512() { try { if (FirmwareSigned != null) { if (FirmwareSigned.Length > 512) { return(FirmwareSigned.ByteSelect(512)); } } } catch (Exception ex) { UiMessages.Error(ex.ToString()); } //default return(null); }
public byte[] EncryptedInstaller() { try { if (FirmwareSigned != null) { if (FirmwareSigned.Length > 512) { return(FirmwareSigned.ByteSelect(FirmwareSigned.Length - 544, 639)); } } } catch (Exception ex) { UiMessages.Error(ex.ToString()); } //default return(null); }
public byte[] SHA512Image() { try { if (FirmwareSigned != null) { if (FirmwareSigned.Length > 512) { var imageBytes = FirmwareSigned.ByteSelect(FirmwareSigned.Length - 512, 511); return(imageBytes.SHA512()); } } } catch (Exception ex) { UiMessages.Error(ex.ToString()); } //default return(null); }