在《通用數據保護條例》或《GDPR》等法律時代,保護用戶信息變得比以往任何時候都更加重要。 捕穫後,它會在我們的服務器上緩存一小段時間,以便能夠下載。 雖然我們的服務器是安全的,但未經許可我們不會檢查用戶的捕獲內容。 在處理個人信息的某些場景下,這還不夠保護。
第一個潛在的改進是通過將緩存長度更改為零分鐘來不再緩存捕獲,在您的 帳戶頁面。 但請注意,這意味著捕獲將無法在很長一段時間內下載,因此必須在創建後立即下載。
另一個可能的安全問題是將敏感數據發送給我們的實際過程。 為了保護這些數據,您應該首先 啟用 SSL,然後一旦我們收到數據並對其進行處理(速度很快),它將自動從我們的系統中刪除,以確保不存在安全漏洞。
還可以通過以下方式為 PDF 或 DOCX 捕獲添加更多安全性: 密碼保護文檔。 這可確保只有具有正確密碼的用戶才能訪問受保護的文件。
但是,如果您正在捕獲非常敏感的信息(例如醫院記錄等)並需要額外級別的保護,您可以對捕獲的結果本身進行加密。 為此,您需要為每個請求指定一個加密密鑰,這些密鑰不會由 GrabzIt 存儲。 該密鑰用於加密保護信息的捕獲。 由於我們不存儲密鑰,因此無法幫助您恢復加密的捕獲。 收到捕穫後,請使用之前生成的密鑰對其進行解密。
在下面的示例中,創建了一個加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後使用相同的加密密鑰來解密結果。
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); grabzIt.UseSSL(true); string encryptionKey = grabzIt.CreateEncryptionKey(); ImageOptions options = new ImageOptions(); options.EncryptionKey = encryptionKey; grabzIt.URLToImage("http://www.spacex.com", options); GrabzItFile encryptedCapture = grabzIt.SaveTo(); GrabzItFile decryptedCapture = grabzIt.Decrypt(encryptedCapture, encryptionKey);
在下面的示例中,創建了一個加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後使用相同的加密密鑰來解密結果。
為了在 Java 6、7 和 8 中使用加密捕獲,請安裝 Java 加密擴展 (JCE) 無限強度管轄策略文件 into Java 安裝文件夾的所有 /jre/lib/security/ 文件夾。
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); grabzIt.UseSSL(true); String encryptionKey = grabzIt.CreateEncryptionKey(); ImageOptions options = new ImageOptions(); options.setEncryptionKey(encryptionKey); grabzIt.URLToImage("http://www.spacex.com", options); GrabzItFile encryptedCapture = grabzIt.SaveTo(); GrabzItFile decryptedCapture = grabzIt.Decrypt(encryptedCapture, encryptionKey);
在下面的示例中,會自動創建加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後,通過將 true 傳遞給 DataURI 方法,使用相同的加密密鑰自動解密結果,然後可以在回調方法中讀取該結果。
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
</head>
<body>
<img id="capture"></img>
function callback(dataUri)
{
document.getElementById('capture').src = dataUri;
}
<script type="text/javascript">
GrabzIt("Sign in to view your Application Key").UseSSL().Encrypt().ConvertURL("http://www.spacex.com").DataURI(callback, true);
</script>
</body>
</html>
在下面的示例中,創建了一個加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後使用相同的加密密鑰來解密結果。
var grabzit = require('grabzit'); var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret"); client.use_ssl(true); var encryptionKey = client.create_encryption_key(); client.url_to_image("http://www.spacex.com", {"encryptionKey":encryptionKey}); client.save_to(null, function (error, result){ if (error != null){ throw error; } var decryptedBytes = client.decrypt(result, encryptionKey); });
不幸的是,Perl 無法本地解密 AES 加密,需要外部可執行文件或 C 編譯。 因此,我們尚未將此功能添加到 Perl API 中,您可以使用下面的指南自行添加此功能。
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret"); $grabzIt->UseSSL(1); $options = GrabzItImageOptions->new(); $options->encryptionKey("UUK2Xo9OLT2dFvN0wPBGOMZRYqD6WxqFtrZK9YrG+Hg="); $grabzIt->URLToImage("http://www.spacex.com", $options); //needs to be decrypted $data = $grabzIt->SaveTo();
在下面的示例中,創建了一個加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後使用相同的加密密鑰來解密結果。
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); $grabzIt->UseSSL(true); $encryptionKey = $grabzIt->CreateEncryptionKey(); $options = new \GrabzIt\GrabzItImageOptions(); $options->setEncryptionKey($encryptionKey); $grabzIt->URLToImage("http://www.spacex.com", $options); $encryptedData = $grabzIt->SaveTo(); $decryptedData = $grabzIt->Decrypt($encryptedData, $encryptionKey);
在下面的示例中,創建了一個加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後使用相同的加密密鑰來解密結果。
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret") grabzIt.UseSSL(True) encryptionKey = grabzIt.CreateEncryptionKey() options = GrabzItImageOptions.GrabzItImageOptions() options.encryptionKey = encryptionKey grabzIt.URLToImage("http://www.spacex.com", options) encryptedData = grabzIt.SaveTo() decryptedData = grabzIt.Decrypt(encryptedData, encryptionKey)
在下面的示例中,創建了一個加密安全密鑰並將其發送到 GrabzIt,然後使用該密鑰對捕獲進行加密。 然後使用相同的加密密鑰來解密結果。
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") grabzIt.use_ssl(true) encryptionKey = grabzIt.create_encryption_key() options = GrabzIt::ImageOptions.new() options.encryptionKey = encryptionKey grabzIt.url_to_image("http://www.spacex.com", options) encryptedData = grabzIt.save_to() decryptedData = grabzIt.decrypt(encryptedData, encryptionKey)
本指南技術性很強,旨在幫助開發人員了解我們的加密工作原理。 它對 Perl 開發人員特別有用,因為該語言沒有不需要完成或安裝 Open SSL 等第三方工具的開源 Perl 包。
加密捕獲使用 256 位高級加密標準 (AES) 加密。 它還使用密碼塊鏈接 (CBC) 塊密碼操作模式。
為了讓 GrabzIt 加密捕獲,需要將 64 個字符長的 Base 44 加密密鑰傳遞給選項對象。 要創建此加密密鑰,您應該選擇 32 個隨機加密安全字節。 然後應將它們編碼為 Base 64。由於它們是加密安全字節,因此很難預測,因此更難破解。
當 GrabzIt 收到帶有加密密鑰的捕獲請求時,捕獲會被加密,並且初始化向量 (IV) 會插入到文件的開頭。 該IV長16字節,解密前需要從文件前面刪除。 IV 還必須傳遞給 AES 算法才能解密。 當捕獲被加密時,不會向文件添加填充,因此在解密時需要禁用填充。
請記住,如果您對我們現有的客戶端 API 之一或全新的語言進行了改進,您可以通過以下方式與社區分享: GitHub上.