Skip to content

An implementation of publicly verifiable proofs of retrievability

License

Notifications You must be signed in to change notification settings

CapacitorSet/por

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-por

A Golang implementation of publicly-verifiable proofs of retrievability, based on work by Shacham and Waters.

Theory

The theory behind the proofs is detailed in Compact Proofs of Retrievability, by Hovav Shacham and Brent Waters. In particular, it implements the Construction with RSA Signatures detailed in section 6.

Implementation

The current implementation tags the file example.txt with an RSA 2048-bit keypair (λ_1 - 1 = 2048), issues a verification request with l = 2 elements, and checks for its correctness.

Example usage

package main;

import (
	"fmt"
	"github.com/CapacitorSet/por"
	"os"
)

func main() {
	fmt.Printf("Generating RSA keys...\n")
	spk, ssk := Keygen()
	fmt.Printf("Generated!\n")

	fmt.Printf("Signing file...\n")
	file, err := os.Open("./example.txt")
	if err != nil {
		panic(err)
	}
	tau, authenticators := St(ssk, file)
	fmt.Printf("Signed!\n")

	fmt.Printf("Generating challenge...\n")
	q := Verify_one(tau, spk)
	fmt.Printf("Generated!\n")

	fmt.Printf("Issuing proof...\n")
	mu, sigma := Prove(q, authenticators, spk, file)
	fmt.Printf("Issued!\n")

	fmt.Printf("Verifying proof...\n")
	yes := Verify_two(tau, q, mu, sigma, spk)
	fmt.Printf("Result: %t!\n", yes)
	if yes {
		os.Exit(0)
	} else {
		os.Exit(1)
	}
}

About

An implementation of publicly verifiable proofs of retrievability

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages