Record Class CryptoDetector.CryptoAnalysis
java.lang.Object
java.lang.Record
cloud.opencode.base.crypto.util.CryptoDetector.CryptoAnalysis
- Record Components:
entropy- Shannon entropy value | 香农熵值looksEncrypted- whether data appears encrypted | 数据是否看起来被加密looksCompressed- whether data appears compressed | 数据是否看起来被压缩hasTextContent- whether data contains readable text | 数据是否包含可读文本uniformDistribution- whether byte distribution is uniform | 字节分布是否均匀detectedEncoding- detected encoding type | 检测到的编码类型detectedKeyFormat- detected key format (if applicable) | 检测到的密钥格式(如果适用)detectedHashFormat- detected hash format (if applicable) | 检测到的哈希格式(如果适用)
- Enclosing class:
CryptoDetector
public static record CryptoDetector.CryptoAnalysis(double entropy, boolean looksEncrypted, boolean looksCompressed, boolean hasTextContent, boolean uniformDistribution, CryptoDetector.EncodingType detectedEncoding, CryptoDetector.KeyFormat detectedKeyFormat, CryptoDetector.HashFormat detectedHashFormat)
extends Record
Result of cryptographic analysis.
加密分析结果。
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionCryptoAnalysis(double entropy, boolean looksEncrypted, boolean looksCompressed, boolean hasTextContent, boolean uniformDistribution, CryptoDetector.EncodingType detectedEncoding, CryptoDetector.KeyFormat detectedKeyFormat, CryptoDetector.HashFormat detectedHashFormat) Creates an instance of aCryptoAnalysisrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedetectedEncodingrecord component.Returns the value of thedetectedHashFormatrecord component.Returns the value of thedetectedKeyFormatrecord component.doubleentropy()Returns the value of theentropyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasTextContentrecord component.booleanReturns true if the data appears to be cryptographic in nature.booleanReturns the value of thelooksCompressedrecord component.booleanReturns the value of thelooksEncryptedrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theuniformDistributionrecord component.
-
Constructor Details
-
CryptoAnalysis
public CryptoAnalysis(double entropy, boolean looksEncrypted, boolean looksCompressed, boolean hasTextContent, boolean uniformDistribution, CryptoDetector.EncodingType detectedEncoding, CryptoDetector.KeyFormat detectedKeyFormat, CryptoDetector.HashFormat detectedHashFormat) Creates an instance of aCryptoAnalysisrecord class.- Parameters:
entropy- the value for theentropyrecord componentlooksEncrypted- the value for thelooksEncryptedrecord componentlooksCompressed- the value for thelooksCompressedrecord componenthasTextContent- the value for thehasTextContentrecord componentuniformDistribution- the value for theuniformDistributionrecord componentdetectedEncoding- the value for thedetectedEncodingrecord componentdetectedKeyFormat- the value for thedetectedKeyFormatrecord componentdetectedHashFormat- the value for thedetectedHashFormatrecord component
-
-
Method Details
-
isCryptographic
public boolean isCryptographic()Returns true if the data appears to be cryptographic in nature. 如果数据看起来具有加密性质则返回 true。- Returns:
- true if cryptographic patterns detected | 如果检测到加密模式则返回 true
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entropy
-
looksEncrypted
public boolean looksEncrypted()Returns the value of thelooksEncryptedrecord component.- Returns:
- the value of the
looksEncryptedrecord component
-
looksCompressed
public boolean looksCompressed()Returns the value of thelooksCompressedrecord component.- Returns:
- the value of the
looksCompressedrecord component
-
hasTextContent
public boolean hasTextContent()Returns the value of thehasTextContentrecord component.- Returns:
- the value of the
hasTextContentrecord component
-
uniformDistribution
public boolean uniformDistribution()Returns the value of theuniformDistributionrecord component.- Returns:
- the value of the
uniformDistributionrecord component
-
detectedEncoding
Returns the value of thedetectedEncodingrecord component.- Returns:
- the value of the
detectedEncodingrecord component
-
detectedKeyFormat
Returns the value of thedetectedKeyFormatrecord component.- Returns:
- the value of the
detectedKeyFormatrecord component
-
detectedHashFormat
Returns the value of thedetectedHashFormatrecord component.- Returns:
- the value of the
detectedHashFormatrecord component
-