ワンクリックで
crypto
Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Gradle build configuration for Xeres including build commands, version management, module structure, and key plugins.
JUnit 6 testing patterns for Xeres including Mockito with constructor injection, test fixtures via *Fakes.java classes, and AssertJ assertions.
ArchUnit architecture rules enforced in Xeres including common module rules (logging, utility classes), app module rules (no field injection, RsService naming), and UI module rules (WindowController naming).
DTO and mapper patterns for Xeres using Java records, canonical constructors with validation, and static mapper utility classes.
Flyway SQL migration patterns for Xeres including naming conventions, H2 database patterns, enum types, foreign keys, and best practices.
Code style, naming conventions, license headers, and patterns for Xeres Java project. Covers Allman braces, utility classes, package structure, and field injection rules.
| name | crypto |
| description | Cryptography patterns for Xeres including PGP operations, key generation, and hash functions with best practices. |
Xeres uses JCE/JCA and BouncyCastle for cryptographic operations. Always use the registered providers.
import org.bouncycastle.openpgp.*;
PGPSecretKeyRingCollection secretKeys = ...
PGPPublicKeyRingCollection publicKeys = ...
// Encrypt
PGPEncryptedDataGenerator encryptedDataGenerator = new PGPEncryptedDataGenerator(
new JcePGPDataEncryptorBuilder(PGPEncryptedData.CAST5)
.setWithIntegrityPacket(true)
.setSecureRandom(new SecureRandom())
.useInsecureRandom() // Only for testing
);
// Decrypt
PGPPrivateKey privateKey = secretKeys.getSecretKey(keyId)
.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder()
.setProvider("BC")
.build(passphrase.toCharArray()));
import org.bouncycastle.bcpg.*;
import org.bouncycastle.openpgp.*;
var keyRingGenerator = new PGPKeyRingGenerator(
V3PGPSignature.POSITIVE_CERTIFICATION,
new PGPSignatureSubpacketGenerator(),
algorithm,
encryptionKey,
creationTime,
"User ID",
symmetricKeyEncryption,
hashedGen,
unhashedGen,
new SecureRandom(),
"BC"
);
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.security.MessageDigest;
Security.addProvider(new BouncyCastleProvider());
MessageDigest digest = MessageDigest.getInstance("SHA-256", "BC");
byte[] hash = digest.digest(data);
SecureRandomUtils class for all random operationsCryptographic identifiers extend Identifier:
public class RsPkIdentifier extends Identifier
{
public static final int LENGTH = 16;
}