History of pgp_2004
The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.
[entries] New entry: pgp_2004 5b18ef2
diff --git a/entries/pgp_2004/__init__.py b/entries/pgp_2004/__init__.py
new file mode 100644
index 0000000..54ee4a4
--- /dev/null
+++ b/entries/pgp_2004/__init__.py
@@ -0,0 +1,58 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+from .. import *
+
+title = "PGP web of trust (2004)"
+description = """The giant component of the network of users of the Pretty Good Privacy (PGP) algorithm for secure information interchange, compiled by Boguñá et al. In the PGP "web of trust", users certify the authenticity of the public keys of other users by signing them. Each node is a user (key), and an undirected edge connects two users if one of them signed the key of the other. The edge list distributed by the authors lists 24 pairs of nodes twice; these duplicates are removed here, giving 24,316 edges, which is the number of edges reported in the literature for this network. This network predates the one in the `pgp_strong` entry (2009), which is the strongly connected component of a later snapshot of the web of trust."""
+tags = ['Social', 'Online', 'Unweighted']
+url = 'https://deim.urv.cat/~alexandre.arenas/data/welcome.htm'
+citation = [('M. Boguñá, R. Pastor-Satorras, A. Díaz-Guilera, A. Arenas, "Models of social networks based on social distance attachment." Physical Review E 70, 056122 (2004)', 'https://doi.org/10.1103/PhysRevE.70.056122')]
+icon_hash = '56a85c8e26855e083a2f78a6'
+upstream_license = None
+upstream_prefix = 'https://deim.urv.cat/~alexandre.arenas/data/xarxes'
+files = [('PGP.zip:PGPgiantcompo.net', None, None)]
+
+def fetch_upstream(force=False):
+ return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+ force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fnames, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fnames, "r") as f:
+ # Pajek file: "*Vertices N", N vertex lines (with labels "v1",
+ # ... and layout coordinates only), an empty "*Arcs" section,
+ # and "*Edges" with lines "i j 1" (1-based)
+ lines = f.read().splitlines()
+ N = int(lines[0].split()[1])
+ start = [i for i, l in enumerate(lines) if l.strip().lower() == "*edges"][0]
+ edges = numpy.array([l.split()[:2] for l in lines[start + 1:] if l.strip()],
+ dtype="int64") - 1
+ edges = numpy.unique(numpy.sort(edges, axis=1), axis=0)
+ g = Graph(directed=False)
+ g.add_vertex(N)
+ g.add_edge_list(edges)
+ yield alt, g