Skip to content

Instantly share code, notes, and snippets.

@ryzhovau
Created June 25, 2025 18:59
Show Gist options
  • Select an option

  • Save ryzhovau/381ee7da4b7d7212c97d565681b04a6b to your computer and use it in GitHub Desktop.

Select an option

Save ryzhovau/381ee7da4b7d7212c97d565681b04a6b to your computer and use it in GitHub Desktop.
The way to transfer info from Aegis to Yandex.Key app
<#
.SYNOPSIS
Converts Aegis data file to Yandex.Key format
.DESCRIPTION
This is a way to import Aegis TOTP records to Yandex.Key
.NOTES
* Export unencrypted *.JSON file from Aegis App
* Edit $AegisExportFile
* Run script
* Import YandexKey.txt to Yandex.Key app
Tested on Aegis 2.1.3, YandexKey 4.4.0, Linux Powershell 7.3.4
.LINK
https://github.com/beemdevelopment/Aegis
https://play.google.com/store/apps/details?id=ru.yandex.key
#>
# Path to unencrypted Aegis backup file
$AegisExportFile = 'aegis-export-plain-20250625-212548.json'
# An import sanitizer
$ErrorActionPreference = 'Stop'
(Get-Content $AegisExportFile | ConvertFrom-Json).db.entries |
# Yandex, Steam and other non-standard algos ignored
Where-Object {$PSItem.info.algo -EQ 'SHA1'} |
ForEach-Object {
# JSON template taken from test YandexKey backup file
[ordered]@{
name = $PSItem.name
secret = $PSItem.info.secret
techInfo = 'otpauth://totp/{0}:{1}?algorithm=SHA1&digits=6&secret={2}&issuer={3}&account_id={4}&period={5}&created_at=1750875535&creation_type=manual' -f $PSItem.issuer, $PSItem.name, $PSItem.info.secret, $PSItem.issuer, $PSItem.uuid, $PSItem.info.period
}
} | ConvertTo-Json | Out-File -FilePath "YandexKey.txt" -Encoding utf8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment