承接 soatok/age 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

soatok/age

Composer 安装命令:

composer require soatok/age

包简介

Pure-PHP implementation of the age file encryption format (c2sp.org/age)

README 文档

README

CI

PHP implementation of age. Supports post-quantum cryptography.

Tip

The author pronounces it [aɡe̞] with a hard g, like GIF, and it's always spelled lowercase.

Installation

composer require soatok/age

Usage

We ecommend using Hybrid ML-KEM-768 + X25519 for identities and recipients.

<?php
use Soatok\Age\Age;
use Soatok\Age\Hybrid\Mlkem768X25519\{
    HybridIdentity,
    HybridRecipient
};

// Generate a new identity for Alice:
$alice = HybridIdentity::generate();

// You can use HybridRecipient::fromString(/* age public key goes here */); to load a public key
// For a runnable example, we generate Bob's on-the-fly:
$bobSecret = HybridIdentity::generate(); 
$bob = $bobSecret->getRecipient();

// Sample encryption:
$aliceToBob = Age::encrypt('hello bob', [$bob]);
// Example decryption:
$bobReads = Age::decrypt($aliceToBob, [$bobSecret]);
var_dump($bobReads); // string(9) "hello bob"

// With optional ASCII armor:
$bobToAlice = Age::encryptArmored('hi alice!', [$alice->getRecipient()]);
$aliceReads = Age::decrypt($bobToAlice, [$alice]);
var_dump($aliceReads); // string(9) "hi alice!"

Limitations

  • P-256 is currently not implemented
    • Nor is Hybrid ML-KEM-768 + P-256
  • Scrypt is not supported

License

This PHP port of age is released under the same 3-Clause BSD license as the Go implementation.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-04-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固